Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery loads on first page load, but not when reloaded in ajax div
    primarykey
    data
    text
    <p>The first time my page loads, all content loads correctly. When loading a the same section of the page again using Ajax (to refresh content), the Jquery does not fully load.</p> <p>Is this because the first time Jquery is activated by 'on page load' or something, so when opened in ajax window - the page hasn't actually reloaded, so Jquery isnt activated?</p> <p>Here's the code I think causes the issue .. does it just need to activating when opened in an ajax div?</p> <pre><code>&lt;!-- Once the page is loaded, initalize the plug-in. --&gt; &lt;script type="text/javascript"&gt; (function ($){ var handler = $('#tiles li'); handler.wookmark({ // Prepare layout options. autoResize: true, // This will auto-update the layout when the browser window is resized. container: $('#main'), // Optional, used for some extra CSS styling offset: 5, // Optional, the distance between grid items outerOffset: 0, // Optional, the distance to the containers border itemWidth: 178 // Optional, the width of a grid item }); // Update the layout. handler.wookmark(); }); })(jQuery); &lt;/script&gt; </code></pre> <p>I should mention that the Jquery is being used for styling reasons (it cleverly styles the page content). I would guess that happens when <code>handler.wookmark();</code> is activated. How can I activate this in the ajax window?</p> <p>I've been asked to provide my ajax code, so here it is:</p> <pre><code>&lt;!-- ajax script --&gt; &lt;script&gt; window.onload = function () { var everyone = document.getElementById('everyone'), favorites = document.getElementById('favorites'); everyone.onclick = function() { loadXMLDoc('indexEveryone'); var otherClasses = favorites.className; if (otherClasses.contains("Active")) { everyone.className = 'filterOptionActive'; favorites.className = 'filterOption'; } } favorites.onclick = function() { loadXMLDoc('indexFav'); var otherClasses = everyone.className; if (otherClasses.contains("Active")) { favorites.className = 'filterOptionActive'; everyone.className = 'filterOption'; } } function loadXMLDoc(pageName) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("leftCont").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","../home/" + pageName + ".php",true); xmlhttp.send(); } } &lt;/script&gt; &lt;!-- ends ajax script --&gt; </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.
 

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