Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery and AJAX not working with Javascript headers
    primarykey
    data
    text
    <p>I am loading some html with AJAX that depends on Javascript headers.</p> <p>I have a jquery powered slideshow on the homepage, and a jquery powered gallery on the next page.</p> <p>My jquery slideshow works, but then when I click on my loadXMLDoc link the jquery gallery will not work.</p> <p>Here's my homepage with the jquery slideshow:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Photo Design&lt;/title&gt; &lt;script type="text/javascript"&gt; function loadXMLDoc() { 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.body.innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ajax_info.php",true); xmlhttp.send(); } &lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="style.css"/&gt; &lt;script type='text/javascript' src='js/jquery.js'&gt;&lt;/script&gt; //Gallery javascript stuff &lt;script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" /&gt; //Slideshow javascript stuff &lt;link rel="stylesheet" href="js/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen"/&gt; &lt;script src="js/prettyPhoto/js/jquery.prettyPhoto.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type='text/javascript' src='js/jquery.aviaSlider.min.js'&gt;&lt;/script&gt; &lt;script type='text/javascript' src='js/custom.min.js'&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("a[rel=example_group]").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'autoScale' : true, 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return ''; } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="javascript:loadXMLDoc()"&gt;Gallery&lt;/a&gt; &lt;div id="content"&gt; &lt;div id="centered"&gt; &lt;ul class='aviaslider' id="frontpage-slider"&gt; &lt;li&gt;&lt;img src="photos/home/1.jpg" alt=""/&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="photos/home/2.jpg" alt=""/&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="photos/home/3.jpg" alt=""/&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="photos/home/4.jpg" alt=""/&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here's my ajax_info.php page:</p> <pre><code> &lt;div id="content"&gt; &lt;div id="gallery"&gt; &lt;div class="thumbnails"&gt; &lt;a rel="example_group" href="photos/seniors/10big.jpg"&gt;&lt;img alt="" src="photos/seniors/10thumb.jpg"/&gt;&lt;/a&gt; &lt;a rel="example_group" href="photos/seniors/11big.jpg"&gt;&lt;img alt="" src="photos/seniors/11thumb.jpg"/&gt;&lt;/a&gt; &lt;a rel="example_group" href="photos/seniors/12big.jpg"&gt;&lt;img alt="" src="photos/seniors/12thumb.jpg"/&gt;&lt;/a&gt; &lt;a rel="example_group" href="photos/seniors/13big.jpg"&gt;&lt;img alt="" src="photos/seniors/13thumb.jpg"/&gt;&lt;/a&gt; &lt;a rel="example_group" href="photos/seniors/14big.jpg"&gt;&lt;img alt="" src="photos/seniors/14thumb.jpg"/&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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