Netsscape fails to run the Body onload, why???

  • Thread starter Thread starter BTHOMASinOHIO
  • Start date Start date
B

BTHOMASinOHIO

In IE, this runs fine, but in Netscape, it doesn't error, but just
doesn't run. WHY?!?!


(in the Page Code Behind)
BODY1.Attributes.Add("onLoad", "DisplayData();")


(in the HTML of the Page)
function DisplayData(){
PanelDescription.style.display = 'none';
PanelBuildingName.style.display = 'none';
PanelOperatorName.style.display = 'none';
PanelManagementName.style.display = 'none';
....(yada yada yada)

Thanks
BTHOMAS71CHEVY-at-EXCITE-dot-COM
 
BTHOMASinOHIO said:
In IE, this runs fine, but in Netscape, it doesn't error, but just
doesn't run. WHY?!?!


(in the Page Code Behind)
BODY1.Attributes.Add("onLoad", "DisplayData();")


(in the HTML of the Page)
function DisplayData(){
PanelDescription.style.display = 'none';
PanelBuildingName.style.display = 'none';
PanelOperatorName.style.display = 'none';
PanelManagementName.style.display = 'none';
...(yada yada yada)

I suggest you see what Netscape is downloading, save that as HTML, and
then get that to work in Netscape (asking in Netscape-specific forums,
perhaps) - then make sure that's what's sent, at least if the browser
is Netscape.
 
I believe the problem you are experiencing is in the DisplayData() function.
Netscape does not support referencing an element directly by ID. For example:

function DisplayData(){
PanelDescription.style.display = 'none';
...
}

I'm assuming you have a <asp:Panel ID="PanelDescription" Runat="server" />
tag, which in IE's JScript you can reference using just it's ID; however,
that will only work in IE browsers. Try changing it to the "correct" syntax
below, which will work cross-browser:

function DisplayData(){
document.getElementByID("PanelDescription").style.display = 'none';
...
}

Hope that helps.
 
Jason,

Yes, you were/are correct.

After I started plugging in "..getElementByID().." to all my
JavaScipt, things started working as planned in Netscape.

Man, I really hadn't planned on rewritting all the Javascript in my
application over Netscape, but I AM !!! :(

I have also had to do some server side validation as well as Netscape
doesn't like:

- "ValidatorEnable(RequiredFieldValidator, false);" Validation
- "Page_ClientValidate();"

Grrrr....

(THANKS !!)
 
Back
Top