JQuery $ (document) .ready () does not start after window.location.href

I have two pages, on the first page after the event, the page location is changed using:

window.location.href = "/pageb";

On the second page, I have an event ready for the document that does not fire when I exit the page above. The finished event works when the page is viewed normally.

$(document).ready(function() {
     alert('ready');      
});

I am using google ajax cdn to include jquery in my pages. I'm at a dead end ...

+5
source share
1 answer

This works for me, although I use jQuery (1.4.1) from my server, and I use:

window.location = "/index.html";

I don’t understand why this can change anything, but maybe you can try anyway?

+1
source

All Articles