Body element onload attribute with NETSCAPE

Discussion in 'ASP .Net Web Controls' started by kw, Aug 18, 2004.

  1. kw

    kw Guest

    I thought both browsers execute script not in a function on the body
    load...but with NS7.1, it does not.

    Therefore, to execute script in an NS browser client on the load of a page
    from a ASP.NET Server Control, I want to modify the onload attribute to the
    Body element to add an Initialize() function. For example: <body
    onload="Initialize();">

    However, this does not appear to be possible...or is it? Is there a
    workaround to get script to execute automatically in NetScape?

    Note: RegisterClientScriptBlock is used to create the Initialize()
    script...but that won't cause it to be executed in NS even if it has script
    no in a function statement.

    Also, I tried doing something like this, but it doesn't work in NS either:
    <script language="javascript" FOR=body EVENT=onload>Initialize();</SCRIPT>
    and also
    <script language="javascript" FOR=window EVENT=onload>Initialize();</SCRIPT>
    kw, Aug 18, 2004
    #1
    1. Advertising

  2. kw

    kw Guest

    never mind...

    OMG, never mind. NS does in fact execute. The problem I had was that the
    default settings weren't telling me that there was an error in the
    javascript leaving me scratching my head because the same code worked in
    IE...just that NS didn't do anything.

    "kw" <> wrote in message
    news:...
    > I thought both browsers execute script not in a function on the body
    > load...but with NS7.1, it does not.
    >
    > Therefore, to execute script in an NS browser client on the load of a page
    > from a ASP.NET Server Control, I want to modify the onload attribute to

    the
    > Body element to add an Initialize() function. For example: <body
    > onload="Initialize();">
    >
    > However, this does not appear to be possible...or is it? Is there a
    > workaround to get script to execute automatically in NetScape?
    >
    > Note: RegisterClientScriptBlock is used to create the Initialize()
    > script...but that won't cause it to be executed in NS even if it has

    script
    > no in a function statement.
    >
    > Also, I tried doing something like this, but it doesn't work in NS either:
    > <script language="javascript" FOR=body

    EVENT=onload>Initialize();</SCRIPT>
    > and also
    > <script language="javascript" FOR=window

    EVENT=onload>Initialize();</SCRIPT>
    >
    >
    kw, Aug 19, 2004
    #2
    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. John Kotuby

    Add body onload attribute from UserControl?

    John Kotuby, Apr 3, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    1,289
    Ben Rush
    Apr 5, 2007
  2. kw
    Replies:
    7
    Views:
    290
  3. David Otton

    window.onload and body.onload differences

    David Otton, Nov 4, 2004, in forum: Javascript
    Replies:
    2
    Views:
    535
    Martin Honnen
    Nov 4, 2004
  4. BTHOMASinOHIO

    NETSCAPE fails to run Body onLoad, WHY ?!?!

    BTHOMASinOHIO, Nov 15, 2004, in forum: Javascript
    Replies:
    2
    Views:
    86
    Martin Honnen
    Nov 15, 2004
  5. yawnmoth
    Replies:
    7
    Views:
    146
Loading...

Share This Page