php - jQuery not working in AJAX loaded DIVs -


I also load jQuery.js and block UI jQuery plugin on top of my document.

In PHP, I use regular AJAX to load other PHP content into DIV. The basic PHP jQuery and blockUI plugin is just fine in the work but none of the AJAX-loaded divs jQuery and blockUI does absolutely nothing at all. There are no console errors, no warnings.

I am the beginning of a jQuery and the other articles I found on this topic were put on the edge of the solution, so I am helping someone and can do their own. In code I will see that I have taken some stubs on live () ...

This is at the top of my PHP file which is loaded into DIV

  Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('# crazy') Live ('click', function () {$ .blockUI ({message: $ ('# question'), CSS: {width: ' 275px '}})}} $ (' 'yes'') live ('click', function () {// block message $ update.blu UI ({message: "& lt; h1> remote call In progress ... .. $. Ajax ({url: 'wait.php', cache: incorrect, complete: function () {// unblock when remote call returns $. UnblockUI ();}});} $ ('#not') live ('click', function () {$. UnblockUI (return; false;;};}); & Lt; / Script & gt;  

Here is HTML from that PHP file (loaded in DIV):

   

Before completing your AGX call, your document's ready work loads when the DOM Loads. Thus, it only calls the existing elements of .live () AJAX calls.

If you want to apply things to the contents loaded by AJAX calls,

once specify a callback function for AJAX that applies the appropriate stuff. Ho.

Comments