开发者

jQuery $(document).ready() not firing after window.location.href

开发者 https://www.devze.com 2022-12-21 21:38 出处:网络
I have two pages, on the first page after an event happens I change the location of the page by using:

I have two pages, on the first page after an event happens I change the location of the page by using:

window.location.href = "/pageb";

On the second page, I have a document re开发者_开发问答ady event that doesn't fire when coming from the page above. The ready event works when the page is browsed to normally.

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

I am using the google ajax cdn to include jquery on my pages. I'm stumped...


It works for me, though I'm using jQuery (1.4.1) from my server, and I use :

window.location = "/index.html";

I don't see why it would change anything, but maybe you could try anyways ?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号