window.onerror problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cainnech
    New Member
    • Nov 2007
    • 132

    window.onerror problem

    Hello everyone,

    I'm building an HTA and because of the fact I'm loading in external pages in an Iframe, I'm getting javascript errors from an external javascript in that page.

    Now I'm trying to block these using window.onerror and returning true, but for some reason it's not working.

    Code:
    window.onerror = function(){return true;}
    However the messages keep appearing.
    Is there a way that I can solve this ?

    Greets,
    Cainnech
  • larztheloser
    New Member
    • Jan 2010
    • 86

    #2
    I think you need to apply that code to the external page, not the main page.

    Comment

    • Cainnech
      New Member
      • Nov 2007
      • 132

      #3
      Well probably that would be a good idea. But the problem is that the external page is not my own. So I can't change that code.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        then you are out of luck ... since this would be 'cross-site-scripting' that is not allowed by any good browser ... read here about the same origi
        n policy

        kind regards

        Comment

        Working...