Can't execute code from a freed script

Discussion in 'Javascript' started by Dirk Gently, Nov 12, 2004.

  1. Dirk Gently

    Dirk Gently Guest

    I have seen a few posts with respect to this error message, but none
    are quite the same situation as mine. My requirements for this web
    application are fairly stringent in that the client browsers are
    running on public (read: tightly controlled) machines with touch
    screens in widely distributed locations. The end users can't have
    access to the browser menus or buttons, so any error-type conditions
    need to be self-correcting.

    I have a simple HTML page which contains a frameset. The frameset has
    only one single frame, which contains all of the visible content of my
    webapp. The first time it loads, the top page opens a new window via
    window.open() with the URL of a separate page on the server. The popup
    page is mainly a scripting window which performs the following
    actions:

    1) tests the server availability by downloading/reloading a one pixel
    image (this works great).
    2) tests the main window for a JavaScript Date variable which is set
    whenever the content frame is reloaded. There are two reasons for this
    test - one is simply the availability of the variable, the other is
    the value of the timestamp.

    The desired behavior is to recover from server downtime, or 404/500
    server errors with no navigation by the users. The top page writes a
    "retry later" type message into the content frame by setting the
    frame's location to a 'javascript:...' pseudo-URL which writes the
    personalized error message. To satisfy this I have the popup testing
    on an interval (currently 30 seconds). Everything works swimmingly
    except for one test case. If the server goes down, and the user
    attempts to navigate before the retry message is written, the content
    frame reverts to "Page cannot be displayed" IE error page. Once this
    occurs, I no longer have access to the child frame to write the
    friendly error message. I get the "Can't execute code from a freed
    script" JavaScript error.

    I attempted to preempt the IE error page by playing tricks with the
    frame's document.onUnload event, but that made matters worse so that
    many of the other cases no longer functioned. Does anyone else have
    experience with this type of scenario?

    Thanks,
    Chris
    Dirk Gently, Nov 12, 2004
    #1
    1. Advertising

  2. Dirk Gently

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > I attempted to preempt the IE error page by playing tricks with the
    > frame's document.onUnload event, but that made matters worse so that
    > many of the other cases no longer functioned. Does anyone else have
    > experience with this type of scenario?
    >


    If this is guaranteed to be run with IE, why not try a .hta instead of .html?
    I believe you get more control over script that way. It may make this error
    go away.

    If that isn't an option, do you have any control over the server? Custom
    404/500 error pages may be a better solution.

    If that's not an option either, how do users navigate? You may be able to
    disallow navigation until the server is checked.

    --
    --
    ~kaeli~
    A man needs a mistress... just to break the monogamy.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Nov 12, 2004
    #2
    1. Advertising

  3. Dirk Gently

    Dirk Gently Guest

    kaeli <> wrote in message news:<>...
    > In article <>,
    > enlightened us with...
    > >
    > > I attempted to preempt the IE error page by playing tricks with the
    > > frame's document.onUnload event, but that made matters worse so that
    > > many of the other cases no longer functioned. Does anyone else have
    > > experience with this type of scenario?
    > >

    >
    > If this is guaranteed to be run with IE, why not try a .hta instead of .html?
    > I believe you get more control over script that way. It may make this error
    > go away.


    We attempted to go the HTA route, but were unable to get the page
    working properly. The page contains a non-visible signed Java applet
    which is used to accept input from a serial bar code reader, and the
    applet was not functioning inside of the HTA.

    >
    > If that isn't an option, do you have any control over the server? Custom
    > 404/500 error pages may be a better solution.


    This is not the issue - I can detect a 40x/50x error with no problem
    because then the page is still in the same domain as the other
    windows/frames. The problem occurs when the server is down, in which
    case IE renders the 'Page cannot be displayed' page, which is local to
    the machine and therefore from a different 'domain' than the
    monitoring script window or the parent frame.

    >
    > If that's not an option either, how do users navigate? You may be able to
    > disallow navigation until the server is checked.


    The users navigate purely through links on the pages - all other
    navigation is disallowed by starting IE with the -K command line
    argument. I am trying to figure out how to properly trap all
    navigation events (user link clicks or periodic META refreshes) in
    order to check the server status. I believe I can solve this problem
    by discovering the server status prior to any navigation event and
    preventing the child page from reverting to local domain, which causes
    it to drop off the radar for the monitor script. Other than that, if
    you have any ideas about how to retain a reference to the content
    page's document object when it goes to 'Page cannot be displayed',
    that would be even better.

    Thanks for your reply,
    Chris
    Dirk Gently, Nov 15, 2004
    #3
  4. Dirk Gently

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > Most people know how to navigate the web and you could build on the
    > knowledge by letting the navigation buttons show through.


    You missed the original. This is not a standard app. It's a kiosk.

    --
    --
    ~kaeli~
    To steal ideas from one person is plagiarism; to steal from
    many is research.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Nov 16, 2004
    #4
  5. Dirk Gently

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > We attempted to go the HTA route, but were unable to get the page
    > working properly. The page contains a non-visible signed Java applet
    > which is used to accept input from a serial bar code reader, and the
    > applet was not functioning inside of the HTA.


    There's no good reason for applets not to work in HTAs. Do you have both Sun
    and MS JVMs on that machine? The machine may be confused as to which one to
    use. Make sure you only have ONE JVM installed.
    You may need to put it in a hidden frame or IFRAME.
    You may need to use an object tag instead of the applet tag.

    > This is not the issue - I can detect a 40x/50x error with no problem
    > because then the page is still in the same domain as the other
    > windows/frames. The problem occurs when the server is down, in which
    > case IE renders the 'Page cannot be displayed' page, which is local to
    > the machine and therefore from a different 'domain' than the
    > monitoring script window or the parent frame.


    That only happens when IE is configured to display friendly error messages,
    as far as I know. Check the setting in IE. Advanced tab : "show friendly HTTP
    error messages" should be unchecked.

    >
    > >
    > > If that's not an option either, how do users navigate? You may be able to
    > > disallow navigation until the server is checked.

    >
    > The users navigate purely through links on the pages - all other
    > navigation is disallowed by starting IE with the -K command line
    > argument. I am trying to figure out how to properly trap all
    > navigation events (user link clicks or periodic META refreshes) in
    > order to check the server status.


    You can do that with attachEvent on all links. Do a getElementsByTagName and
    iterate through them and attachEvent to each.

    > Other than that, if
    > you have any ideas about how to retain a reference to the content
    > page's document object when it goes to 'Page cannot be displayed',
    > that would be even better.


    Do check that IE advanced option. I wonder if that's the real problem...

    --
    --
    ~kaeli~
    To steal ideas from one person is plagiarism; to steal from
    many is research.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Nov 16, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajat
    Replies:
    3
    Views:
    689
    Jorgen Grahn
    Jan 8, 2010
  2. Martin Waller

    Can't execute code from freed script

    Martin Waller, Dec 3, 2004, in forum: ASP General
    Replies:
    1
    Views:
    250
    Martin Waller
    Dec 3, 2004
  3. reformy
    Replies:
    2
    Views:
    222
    LV_Indy
    Jun 30, 2005
  4. Thor W Hammer

    Freed script

    Thor W Hammer, Nov 21, 2005, in forum: Javascript
    Replies:
    4
    Views:
    121
    Thor W Hammer
    Nov 23, 2005
  5. maya
    Replies:
    2
    Views:
    186
Loading...

Share This Page