- Where Developers Learn, Share, & Build Careers
I've been trying to fix this problem for the last 2-3 hours, but finally left it. This is part of my JavaScript / jquery
$ (function () {$ ('' ob '). ); Var form_data = {id: id, ob: 3}; $ .ajax ({url: "changeinfo.php", type: 'post', data: form_data, success: function (data) {$ ("# finfoob3 ") .html (data);}}); details are false;});}); The above successfully modifies a DIV element on the change.
However in that div element, there is an ID = obt3 button that does not work. Actually, this name was written on something else. I have sent another post value OB to call AJAX and have included it with receiving so that it is obt3. I then put the button to get the ID but it still will not respond to a click event.
I tried to check the element with Google Chrome and the ID of the element was successfully converted into obt3, but it will not be answered on click event.
The problem is that when you changed the contents of #finfoob3 With all of your lost event handlers, all the nodes you lost there. There are two ways to control it: - After changing the div content, recreate whatever event handler you have.
- Event handlers to
#Finfoob3 , so when you change its content, they will not be lost. Since you are using jQuery, you should see the function. This gives you an easy way to define the event delegation.
Comments
Post a Comment