Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery dont load until refresh?
    primarykey
    data
    text
    <p>I'm working on a personal website to expand my jQuery knowledge. I have written this page in PHP and it works fine with no console errors: <a href="http://sallibert.com/apps/notes/notes.php" rel="nofollow">http://sallibert.com/apps/notes/notes.php</a></p> <p>But, when I call it using an include in the index file, the animation gets stuck on load: <a href="http://sallibert.com/index.php#!notes" rel="nofollow">http://sallibert.com/index.php#!notes</a></p> <p>The JS links are good, and there are no bad links.</p> <p>I have tried these different solutions and none of them work:</p> <ul> <li>Place the JS links in the body</li> <li>Replace <code>$('document').ready(function(){</code> with <code>jQuery(document).ready(function(){</code></li> <li>jQuery.noConflict();</li> </ul> <p>Does anyone have any ideas to fix this bug? Thanks for the help!</p> <p><strong>EDIT :</strong></p> <p>I have updated the links above, you can check it now. I have no errors logs on firefox but now on chrome, i got two of them. I try to solve them:</p> <p>Uncaught TypeError: Cannot call method 'toLowerCase' of undefined The first bug is linked to this, i think.</p> <p>And</p> <p>Uncaught TypeError: Cannot read property 'style' of null First, i load append the html using the html, then, when the page is loaded, apply some JS:</p> <pre><code>$(document).ready(function(){ ... $('#horloge .app_logo').append('&lt;img class="aigfix" id="aigS" src="img/aigS.png" alt="" style="transform: rotate(314784deg);"&gt;&lt;img class="aig" id="aigM" src="img/aigM.png" alt="" style="transform: rotate(5246deg);"&gt;&lt;img class="aighfix" id="aigH" src="img/aigH.png" alt="" style="transform: rotate(437deg);"&gt;'); .... }); window.onload = function() // wait before load { var d = new Date(); var time = d.getSeconds() + 60 * d.getMinutes() + 3600 * d.getHours(); var aigS = document.getElementById('aigS'); var aigM = document.getElementById('aigM'); var aigH = document.getElementById('aigH'); aigS.style.MozTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.WebkitTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.OTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.msTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.transform = 'rotate(' + (time * 6) + 'deg)'; aigM.style.MozTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.WebkitTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.OTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.msTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.transform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigH.style.MozTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.WebkitTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.OTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.msTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.transform = 'rotate(' + Math.round(time / 120) + 'deg)'; setInterval(function() { time++; aigS.style.MozTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.WebkitTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.OTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.msTransform = 'rotate(' + (time * 6) + 'deg)'; aigS.style.transform = 'rotate(' + (time * 6) + 'deg)'; aigM.style.MozTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.WebkitTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.OTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.msTransform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigM.style.transform = 'rotate(' + Math.round(time / 10) + 'deg)'; aigH.style.MozTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.WebkitTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.OTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.msTransform = 'rotate(' + Math.round(time / 120) + 'deg)'; aigH.style.transform = 'rotate(' + Math.round(time / 120) + 'deg)'; }, 1000); } </code></pre> <p>the php include code is:</p> <pre><code>&lt;?php $appid = strtolower($_GET['appid']); if($appid &amp;&amp; file_exists('apps/'.$appid.'/'.$appid.'.php')){ header('Location: apps/'.$appid.'/'.$appid.'.html'); } ?&gt; </code></pre> <p>Update2: I just have seen that the apps in the folder are undefined. I call them using an array: $apps[1] = Array( 'Maps', Array('CV',Array('Complet','Expériences','Compétences','Diplomes','Autres','Rech‌​erche')), 'Messages', ... ); I have solved the Uncaught TypeError: Cannot call method 'toLowerCase' of undefined. But it didnt solve the main problem, the bug load of the notes apps.</p> <p>Thanks for the help!</p>
    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