0

I am experimenting with the codes from Setting location.hash in frames. It works well in IE and FF, but Chrome throws the error:

Uncaught TypeError: Cannot read property 'location' of undefined

Can anybody explain why only Chrome thorws this error? Thanks.

Community
  • 1
  • 1
Ricky
  • 34,377
  • 39
  • 91
  • 131
  • what is your code? when i open the console and type `document.location.hash = "works"` it seems fine – James Khoury Jun 20 '11 at 04:59
  • yup, it works well inside console. It get wrong if you run the .html. – Ricky Jun 20 '11 at 06:14
  • can you put up an example? I have it working fine: ` ` I'm guessing you've misspelled something. – James Khoury Jun 20 '11 at 07:10

1 Answers1

1

try this:

window.location.href = "welcome.htm";