"Microsoft JScript runtime error: Redeclaration of const property"
Whatever variable I have used in my script are declared only one time.
Weird issue is that I am using IE9 browser here when I open site in compatibility mode it works fine without any error, however when I run application in normal mode in IE9 it throws an error.
How do I get rid of this JS error, as I mentioned this was not a problem before.
This suggests that IE finds what it thinks is an error, so loads the page again in Quirks mode. Loading the page twice makes it think everything is declared twice. So the solution is to find what IE didn't like.
First I ran the page through the
online HTML validator. Next I ran my javascript through
jsLint. After all that, IE9 seemed happy. And as a bonus I have better quality code. I hope.
additionally, I'd like to suggest you check you page to use the W3C tests at
http://validator.w3.org Use the options on that page to change your DTD to a transitional DTD, you may have better outcomes.
Hope this helps, thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
amolpandit22
Participant
1940 Points
418 Posts
Microsoft JScript runtime error: Redeclaration of const property
Jan 29, 2013 06:06 AM|LINK
Hi,
While page load I am facing following error.
"Microsoft JScript runtime error: Redeclaration of const property"
Whatever variable I have used in my script are declared only one time.
Weird issue is that I am using IE9 browser here when I open site in compatibility mode it works fine without any error, however when I run application in normal mode in IE9 it throws an error.
How do I get rid of this JS error, as I mentioned this was not a problem before.
Yanping Wang...
All-Star
15197 Points
1556 Posts
Microsoft
Re: Microsoft JScript runtime error: Redeclaration of const property
Jan 30, 2013 08:29 AM|LINK
Hi amolpandit22,
I would like to suggest you check the answer in the following post
http://stackoverflow.com/questions/7578163/js-error-redeclaration-of-var-when-its-first-line-in-program
the solution in that post may help you.
This suggests that IE finds what it thinks is an error, so loads the page again in Quirks mode. Loading the page twice makes it think everything is declared twice. So the solution is to find what IE didn't like.
First I ran the page through the online HTML validator. Next I ran my javascript through jsLint. After all that, IE9 seemed happy. And as a bonus I have better quality code. I hope.
additionally, I'd like to suggest you check you page to use the W3C tests at http://validator.w3.org Use the options on that page to change your DTD to a transitional DTD, you may have better outcomes.
Hope this helps, thanks.
Feedback to us
Develop and promote your apps in Windows Store