I am using jQuery in a page. I am calling the script from the head section through GoogleApis CDN. At the end of my page i use
$(document).ready(function () {
// code
//
// do something
//
//
setInterval(function() { location.reload(true); }, 40000);
});
The problem is that many times after the page refreshes I am getting the error:
$ is not defined
on document.ready line
and the script stops.
For some reason the jquery in the head is not loaded and throws the error. This happens only when the page loads through javascript location.reload(true) method.
Why?
The page is placed in an iframe. But the error is also happening if it is called directly.