Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Body element onload attribute with NETSCAPE

Reply
Thread Tools

Body element onload attribute with NETSCAPE

 
 
kw
Guest
Posts: n/a
 
      08-18-2004
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>


 
Reply With Quote
 
 
 
 
kw
Guest
Posts: n/a
 
      08-18-2004
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>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add body onload attribute from UserControl? John Kotuby ASP .Net 5 04-05-2007 01:29 AM
Validation (XHTML 1.0 Transitional): Attribute 'leftmargin' is not a valid attribute of element 'body'. anonymous ASP .Net 1 08-02-2006 08:05 AM
NETSCAPE fails to run Body onLoad, WHY ?!?! BTHOMASinOHIO Javascript 2 11-15-2004 05:01 PM
window.onload and body.onload differences David Otton Javascript 2 11-04-2004 04:34 PM
how can server control change BODY onload attribute? kw ASP .Net Web Controls 7 08-16-2004 02:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57