none
IE9 javascript error

    Question

  • My web site  www.USCAmpgrounds.info, which uses Javascript, is rendered correctly in every browser (inlcuding IE8)  EXCEPT IE9.   Can you help me solve this problem?  Thanks.  Tom Hillegass
    Wednesday, May 04, 2011 2:58 PM

Answers

  • Hi Tom,

    Thanks for your post.

    When I open your website, it popups javascript error from functions.js which is a file about google maps.

    However if I run it under IE9 standards mode, the error disappears.

    Therefore,  I suggest you validate your markup at http://validator.w3.org and correct the errors at first, then please try to force your page into IE9 mode(document mode: IE9 mode) by adding meta tag <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> at head section.

    Hope this helps, thanks.

    Best regards,

    Yanping Wang


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework


    Friday, May 06, 2011 8:21 AM
    Moderator

All replies

  • Hi Tom,

    Thanks for your post.

    When I open your website, it popups javascript error from functions.js which is a file about google maps.

    However if I run it under IE9 standards mode, the error disappears.

    Therefore,  I suggest you validate your markup at http://validator.w3.org and correct the errors at first, then please try to force your page into IE9 mode(document mode: IE9 mode) by adding meta tag <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> at head section.

    Hope this helps, thanks.

    Best regards,

    Yanping Wang


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework


    Friday, May 06, 2011 8:21 AM
    Moderator
  • HI Yanping:

     

    Can you tell me where the error is in functions.js - a line number or something?

     

    How can I see that error popup in my IE9 ?

     

    Thank you, Tom Hillegass


    Tom Hillegass www.SwimmingHoles.info www.USCAmpgrounds.info
    Thursday, May 12, 2011 2:32 AM
  • Hi Tom,

    thanks for your reponse.

    How can I see that error popup in my IE9 ?

    1, "Tools" | "Developper Tools ( F12 )" Then "SCRIPT" | "Console" to check the javascript error

    2, IE browser menu --> Tools -->Internet Options --> Advanced --> Browsing -->select Display a notification about every script error Then refresh your webpage to see error popup

    hope this helps, thanks.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework
    Thursday, May 12, 2011 3:15 AM
    Moderator
  • Yanping:

     

    The programmer fixed the problem, here is what he did:

    Essentially, I changed this:
    
      if (!document.getElementById('xyz')) { xyz = My_Function(); }
    
    ...to this:
    
      if (!document.getElementById('xyz')) { xyz_object = My_Function(); }
    
    ...and I changed all other instances of xyz to xyz_object.
    
    
    Apparently IE doesn't like it if you have JavaScript variables with the same name as a document element. I suspect IE's behavior is broken and non-standard in this respect,
    

    Tom Hillegass www.SwimmingHoles.info www.USCAmpgrounds.info
    Thursday, May 12, 2011 9:46 PM
  • Glad to hear that you got it figured out.

    Best regards,

    Yanping Wang


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework
    Friday, May 13, 2011 1:56 AM
    Moderator