19 Kasım 2007 Pazartesi

Window.location.href not working in IE for every page

There is a problem about javascript redirect in Internet Explorer. I couldn't redirect to another page in IE using

window.location.href = url;

This command gets executed (proofed with alert messages) but nothing happens. Firefox acts like expected but i couldn't get it work in IE.

I have finally found the solution after some google search.

RedirectUrl = url;
setTimeout( "window.location.href = RedirectUrl", 0 );

Another solution says that if you set this from the window.location.href in a Javascript function, is enough to return false. Check this out: IE bug.

Hiç yorum yok: