Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    71
    Thanks
    8
    Thanked 0 Times in 0 Posts

    How to stop Internet Explorer script error messages?

    Hi,


    I'm using HTA with iframes contains external web pages, lot of pages (external - not mine) contains errors and while running 'script error' pops.
    If running the same pages in IE there are only error notice in the bottom left side of the browser.

    Can I do something to ignore those script error popups in my HTA?
    (I'm using also Javascript for my HTA)

    Could I use javascript code to stop Internet Explorer script error messages?


    Regards

    Bob
    Last edited by BOBKUSPE; 01-01-2012 at 06:57 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    Try this:

    Bring up MSIE.

    Click on the VIEW menu (or TOOLS icon if using MSIE 9)

    Click on INTERNET OPTIONS menu item.

    Click on ADVANCED tab.

    CHECK "disable script debugging (internet explorer)"

    UNCHECK "display a notification about every script error".

    Not sure that will do it, but try it.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    71
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Hi

    I am looking for a programmatically solution. It is possbiel? I do not found any script about that on the Web.

    Regarding the IE I have disabled this option, but the error message continues.
    Last edited by BOBKUSPE; 01-02-2012 at 02:30 AM.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    You can modify your JS code to ignore errors, but you have to do it one function at a time, in general.

    You could code a function something like this:
    Code:
    function  name( any, arguments )
    {
        try {
            ... normal content of the function ...
       } catch ( ignored ) {
            /* do nothing when there is an error */
       }
    }
    Not that an outer function with the try ...catch will cause an error in an inner function to be ignored, so you may not need this technique on all functions.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,855
    Thanks
    22
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by BOBKUSPE View Post
    I am looking for a programmatically solution. It is possbiel? I do not found any script about that on the Web.
    I would say there is no practical, programmatic solution for handling JS errors in an external web page (loaded in your iframe).

    The best you could do is to use cURL with a server side language to get the source code of the external page(s), use some regular expressions to insert some try/catch blocks, and then insert the resulting markup into a pseudo-iframe on your site. But that's an awful lot of trouble to go to correct errors in someone else's code. And what if the external site changes its code and/or updates its content? Your regular expressions may stop working.

    Your best bet is to try to manually shut off the errors in IE, if you can. You could try disabling JS altogether, but then you can't use JS in your HTA. Perhaps you can find something similar to NoScript for IE that you could use to selectively turn off JS for embedded frames.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    Whoops...I missed that he said "lots of pages (not mine)". I thought he was talking about all his own code when he said he was using HTA. Teach me not to read more closely.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •