Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem loading content with jquery
    primarykey
    data
    text
    <p>Ahoy everyone,</p> <p>I try to load content into a div using <a href="http://net.tutsplus.com/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/" rel="nofollow noreferrer">this</a> tutorial. I am using jquery for this. The problem is that, when i click the link </p> <pre><code>&lt;a href="about.html" class="panel"&gt;Profil&lt;/a&gt; </code></pre> <p>it loads about.html as a seperate page. I tried it with several scripts, but for some reason it looks like</p> <pre><code> $("#content").load </code></pre> <p>does not work at all! I am sure my HTML is valid as i took it nearly 1:1 from the tutorial and only modified the targets.</p> <p>heres the full javascript;</p> <pre><code>$(document).ready(function() { // Check for hash value in URL var hash = window.location.hash.substr(1); var href = $('#nav li a').each(function(){ var href = $(this).attr('href'); if(hash==href.substr(0,href.length-5)){ var toLoad = hash+'.html #content'; $('#container').load(toLoad) } $('#nav li a').click(function(){ var toLoad = $(this).attr('href')+' #content'; $('#container').hide('fast',loadContent); $('#load').remove(); $('#wrapper').append('&lt;span id="load"&gt;LOADING...&lt;/span&gt;'); $('#load').fadeIn('normal'); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5); function loadContent() { $('#container').load(toLoad,'',showNewContent()) } function showNewContent() { $('#container').show('normal',hideLoader()); } function hideLoader() { $('#load').fadeOut('normal'); } return false; }); }); </code></pre> <p>What could be possible reasons of this? </p>
    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.
    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