Will work in IE but not NN - any help please?

M

Mark

Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.asp','search')">Search
<img src="images/mt_srch.gif" width="16" height="16" border="0"
align="absmiddle"></td>

...will work in IE6, but not in NN6.2.

It does not recognize the nowrap, the width attribute, or the onClick.

I need to convert something for NN as soon as possible, and would
appreciate any help,

Many thanks,
 
K

kaeli

Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.asp','search')">Search
<img src="images/mt_srch.gif" width="16" height="16" border="0"
align="absmiddle"></td>

..will work in IE6, but not in NN6.2.

Not work?
Well, if the function isn't working, we'd need to see the function. And
we'd need to know what it is supposed to do and what it is actually
doing.
It does not recognize the nowrap, the width attribute, or the onClick.

Run the file through an HTML validator. I bet it catches something.


--
 
J

Janwillem Borleffs

Mark said:
Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.asp','search')">Search
<img src="images/mt_srch.gif" width="16" height="16"
border="0" align="absmiddle"></td>

..will work in IE6, but not in NN6.2.

It does not recognize the nowrap, the width attribute, or the onClick.

When using a doctype declaration, NN goes into strict mode, which means that
attributes must have values (`nowrap="nowrap"` instead of `nowrap`) and
their names must be lowercased (`onclick` instead of `onClick`).

While at it, learn yourself to use css instead of the old HTML tag
attributes, e.g.:

<td style="white-space:nowrap;width:116px;height:22px" id="toptSearch"
class="mtTabOnTop"
onclick="changeLoc('fixit_proceduresresultstick.asp','search')">Search
<img src="images/mt_srch.gif"
style="width:16px;height:16px;border:none;text-align:middle" /></td>

Of course most (if not all) properties in the style attribute's value should
be moved to the specified class...


JW
 
J

Janwillem Borleffs

Janwillem said:
When using a doctype declaration, NN goes into strict mode, which
means that attributes must have values (`nowrap="nowrap"` instead of
`nowrap`) and their names must be lowercased (`onclick` instead of
`onClick`).

The above is depending on the used doctype, check w3.org for details.


JW
 
M

Mark

Hi - sorry, it appears the onclick works - but the following javascript
does not work in NN (ok in IE):

function changeLoc(loc,tab){
parent.frames['mainFrame'].location.href=loc;
changeTab(tab);
}

function changeTab(tab)
{
if (tab == "search" || tab == "newsearch" ){
toptSearchb.className="mtTabOnB"
toptQuicklinksb.className="mtTabOffB"
toptAdminb.className="mtTabOffB"
toptOtherb.className="mtTabOffB"
toptSearch.className="mtTabOnTop"
toptQuicklinks.className="mtTabOff"
toptAdmin.className="mtTabOff"
toptOther.className="mtTabOffns"
<% if session("browsol")="1" then %>
toptBrowseb.className="mtTabOffB"
toptBrowse.className="mtTabOff"
<% end if %>

}
else if (tab == "quicklinks"){
toptSearchb.className="mtTabOffB"
toptQuicklinksb.className="mtTabOnB"
toptAdminb.className="mtTabOffB"
toptOtherb.className="mtTabOffB"
toptSearch.className="mtTabOff"
toptQuicklinks.className="mtTabOnTop"
toptAdmin.className="mtTabOff"
toptOther.className="mtTabOffns"
<% if session("browsol")="1" then %>
toptBrowseb.className="mtTabOffB"
toptBrowse.className="mtTabOff"
<% end if %>


}
else if (tab == "admin"){
toptSearchb.className="mtTabOffB"
toptQuicklinksb.className="mtTabOffB"
toptAdminb.className="mtTabOnB"
toptOtherb.className="mtTabOffB"
toptSearch.className="mtTabOff"
toptQuicklinks.className="mtTabOff"
toptAdmin.className="mtTabOnTop"
toptOther.className="mtTabOffns"
<% if session("browsol")="1" then %>
toptBrowseb.className="mtTabOffB"
toptBrowse.className="mtTabOff"
<% end if %>
}
else if (tab == "other"){
toptSearchb.className="mtTabOffB"
toptQuicklinksb.className="mtTabOffB"
toptAdminb.className="mtTabOffB"
toptOtherb.className="mtTabOnB"
toptSearch.className="mtTabOff"
toptQuicklinks.className="mtTabOff"
toptAdmin.className="mtTabOff"
toptOther.className="mtTabOnTop"
<% if session("browsol")="1" then %>
toptBrowseb.className="mtTabOffB"
toptBrowse.className="mtTabOff"
<% end if %>
}
else if (tab == "browse"){
toptSearchb.className="mtTabOffB"
toptQuicklinksb.className="mtTabOffB"
toptAdminb.className="mtTabOffB"
toptOtherb.className="mtTabOffB"
toptSearch.className="mtTabOff"
toptQuicklinks.className="mtTabOff"
toptAdmin.className="mtTabOff"
toptOther.className="mtTabOff"
<% if session("browsol")="1" then %>
toptBrowseb.className="mtTabOnB"
toptBrowse.className="mtTabOnTop"
<% end if %>

}
else {
toptSearchb.className="mtTabOffB"
toptQuicklinksb.className="mtTabOffB"
toptAdminb.className="mtTabOffB"
toptOtherb.className="mtTabOnB"
toptSearch.className="mtTabOff"
toptQuicklinks.className="mtTabOff"
toptAdmin.className="mtTabOff"
toptOther.className="mtTabOnTop"
toptBrowseb.className="mtTabOffB"
toptBrowse.className="mtTabOff"
}
}
 
L

Lasse Reichstein Nielsen

Janwillem Borleffs said:
When using a doctype declaration, NN goes into strict mode, which means that
attributes must have values (`nowrap="nowrap"` instead of `nowrap`) and
their names must be lowercased (`onclick` instead of `onClick`).

Nope (I assume NN refers to Netscape 6+ (i.e., Mozilla)).

Even in HTML 4.01 Strict, attribute names are not case sensitive, so I
seriously doubt that Mozilla will not understand "onClick". Only in XHTML
are attribute names case sensitive.

Also, the nowrap attribute is simply not applicable to a TD in HTML
4.01 Strict, so it is at most ignored. Shorthand attributes *are*
valid, so, e.g., <select multiple> is valid, and is understood by
Mozilla.

With this DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
Mozilla FB 0.7 accepts any case of attribute names and the boolean
attribute "multiple". Actually (just checked), it accepts "nowrap" as
well, and honors it, even though it is deprecated and therefore
shouldn't be in HTML 4 Strict.
While at it, learn yourself to use css instead of the old HTML tag
attributes, e.g.:

That is always true :)
/L
 
L

Lasse Reichstein Nielsen

Mark said:
Hi - sorry, it appears the onclick works - but the following javascript
does not work in NN (ok in IE): ....
toptSearchb.className="mtTabOnB"

I assume "toptSearchb" is the id of some element on the page.
Only IE makes global variables of the same name to refer to
such elements. Generally, you should use:

document.getElementById("toptSearchb").className="mtTabOnB";
etc.

If it is important that your page works in IE 4, which doesn't
have document.getElementById, you can test for its existence,
and then use document.all if getElementById doesn't exist.

From what you are doing (dynamically changing the style class),
I doubt it should work in Netscape 4. otherwise there are even
more hoops to go through.

/L
 
M

Mark

Hi - thank you for all of the help so far.

I have now changed it to parent.frames[1].location.href - which works -
not sure why the other way didn't.

However, changeing the cssclass does not -

I had:

toptSearchb.className="mtTabOnB"

...which did not work. I changed it to:

document.getElementById("toptSearchb").className="mtTabOnB";

...but that still does not work in NN7.

Any ideas?

Thanks and happy new year.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top