Note that there are some explanatory texts on larger screens.

plurals
  1. PODebugging AJAX + Jquery Webpage - dynamic loading of contents seems not working
    primarykey
    data
    text
    <p>I've found a possible bug while i was using jquery and Ajax function on my new website, or more probably some big bug on my code that is driving me crazy.</p> <p>Here's the website url for further documentation, <a href="http://phpschool.altervista.org/is/" rel="nofollow">http://phpschool.altervista.org/is/</a></p> <p>The problem occurs when i call the function loadXML to load some contents using ajax this way:</p> <pre><code> $("#menubar .button").live("click",function () { $("#aj_load").fadeOut("slow", function() { loadXML('archive/'+$(this).attr("id")+'.html'); }); }); // #menubar .button is the identifier for the menu buttons. // #aj_load is the div that contains ajax contents when requested. </code></pre> <p>So the meaning of this code, should be </p> <pre><code>Fade out the contenitor aj_load, Load Contents using ajax, Show out the contenitor with contents, </code></pre> <p>But, When i do so, ajax request report error 404 or 12000, and the script stops running.</p> <p>If you try on the website to click the about button for example, you should see it's working correctly, because i've modified the code in order to remove the fadeOut function from the contenitor:</p> <pre><code> $("#menubar .button").live("click",function () { loadXML('archive/'+$(this).attr("id")+'.html'); }); </code></pre> <p>Why a fade function should interfere anyway with ajax requests? I can't explain this. </p> <p>loadXML contains .load() function from jquery, you can see it on the website.</p> <p>Thanks very much,</p> <p>EDIT:</p> <pre><code>function loadXML(xmlURL) { resetStyles(); $("#aj_load").load(xmlURL+" #content0"+cur_seq, function(response, status, xhr) { if (status == "error") { var msg = "Pagina Non Trovata: "; $("#aj_load").html('&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;h3 style="text-align:center"&gt;'+msg + xhr.status + " " + xhr.statusText+'&lt;/h3&gt;'); } else { num_seq = $("#aj_content").text(); if(num_seq !="0") { $("#less").off("click").on("click", function() { $("#aj_load").fadeOut("slow",function() { slideUP(num_seq); loadNEXT(xmlURL,"prev"); }); }); $("#more").off("click").on("click", function() { $("#aj_load").fadeOut("slow",function() { slideDW(num_seq); loadNEXT(xmlURL,"next"); }); }).fadeIn("slow"); } } }).delay(300).fadeIn("slow",function(){inAnimation();}); } </code></pre>
    singulars
    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