开发者

JavaScript window.location and JS Frame error

开发者 https://www.devze.com 2023-01-03 19:47 出处:网络
I\'m trying to redirect a page via JavaScript: window.location(\'http://www.google.com\'); but in firefox, I\'m getting this error:

I'm trying to redirect a page via JavaScript:

window.location('http://www.google.com');

but in firefox, I'm getting this error:

Error: uncaught exception: [Exception... "Cannot convert WrappedNative to function" nsresult: "0x8057000d (NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN)" location: "JS frame :: [url of my page] :: anonymous :: line 1809&qu开发者_C百科ot; data: no]

and, well, I have no idea what that means. What's a JS frame? I'm not using any frames on the page itself.

Stumped.


Do it like this:

window.location.href = 'http://www.google.com';
0

精彩评论

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