0

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" 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.

1 Answer 1

2

Do it like this:

window.location.href = 'http://www.google.com';
Sign up to request clarification or add additional context in comments.

1 Comment

No problemo. For future reference, the MDN (neé Mozilla Dev Center) is a great resource for this sort of stuff.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.