Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery not working on html called in from Ajax scripts
    primarykey
    data
    text
    <p>I've had a look at some of the other post i could not make heads or tails of them. the jquery works fine when page is load be when the same elements are loaded from the ajax script the jquest doesn't work. i understand i need to do a clal back but can some please show me how this is written?</p> <p>html:</p> <pre><code>&lt;div id="item-list2"&gt; &lt;div class="content drag-desired"&gt; &lt;div class="product"&gt;&lt;img src="img/products/iPod.png" alt="iPod" width="128" height="128" class="pngfix" /&gt;iPod&lt;/div&gt; &lt;div class="product"&gt;&lt;img src="img/products/iMac.png" alt="iMac" width="128" height="128" class="pngfix" /&gt;iMac&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>jquery:</p> <pre><code>$(document).ready(function(){ $(".product img").draggable({ containment: 'document', opacity: 0.6, revert: 'invalid', helper: 'clone', zIndex: 100 }); $("div.content.drop-here").droppable({ drop: function(e, ui) { var param = $(ui.draggable).attr('src'); if($.browser.msie &amp;&amp; $.browser.version=='6.0') { param = $(ui.draggable).attr('style').match(/src=\"([^\"]+)\"/); param = param[1]; } viewlist(param); addlist(param); } }); }); </code></pre> <p>Ajax script:</p> <pre><code>function viewlist(param) { $.ajax({ type: "POST", url: "ajax/items.php", data: 'img='+encodeURIComponent(param), dataType: 'json', beforeSend: function(x){$('#ajax-loader').css('visibility','visible');}, success: function(msg2){ $('#item-list2').append(msg2.txt); } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload