ajaxboy / cjax

Lightweight Ajax Framework built in PHP with no foot-print. Allows you to build ajax functionality with a single line of code & do so much more, right from the back-end!
http://cjax.sourceforge.net/
66 stars 27 forks source link

bind new bottons #50

Closed frecervantes closed 2 years ago

frecervantes commented 3 years ago

after an cjax call and update a div, the response create new bottons on the html loaded, is there any way to bind this bottons to a cjax call and fire it on any trigger like onClick but only when the user want it. the on() method is usable if i want to fire it inmediatly after a success cjax call. but limited mostly to messages an some others but not usefull for interaction with the server.

For Example: create a select depending on selected option of a parent select; and show a form with it's text-fields, checkboxes, selects validated and submited with cjax.

Can I do it with cjax?, I hope so because this is an incredible framework.

thanks in advance for your answer.

ajaxboy commented 3 years ago

thanks in advance for your answer.

Apologies for the late reply - Yes you should be able to use issue Cjax trigger events within a response where you issue new elements (buttons, etc) - that is essential and one of Cjax's strengths. You should be able to find quite a few use samples within the examples included. Hope this helps

Cj

frecervantes commented 3 years ago

thanks for your answer. Indeed I read and found some examples and tested with singles scripts. but an issue appears, I had tried to correct it but did not find the origin of it. I'll appreciate your help. this is the error message:

cjax.js:4739 Uncaught TypeError: jQuery.ajaxSetup is not a function at Object.CJAX_FRAMEWORK.onStartEvents [as fn] (cjax.js:4739) at :9:11 at r (cjax.js:4670) at :1:1

it appears after include a header.php script. this is the header.php

OnRedNet
ajaxboy commented 2 years ago

This may be related to the version of JQuery