By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,569 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,569 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.as p','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,

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
In article <3f*********************@news.frii.net>, an*******@devdex.com
enlightened us with...
Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.as p','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.
--
--
~kaeli~
What do they use to ship styrofoam?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

P: n/a
Mark wrote:
Hi - could anyone please tell me why this line:
<td width="116" height="22" nowrap id="toptSearch" class="mtTabOnTop"
onClick="changeLoc('fixit_proceduresresultstick.as p','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.as p','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

Jul 20 '05 #3

P: n/a
Janwillem Borleffs wrote:
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

Jul 20 '05 #4

P: n/a
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"
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5

P: n/a
"Janwillem Borleffs" <jw@jwscripts.com> writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #6

P: n/a
Mark <an*******@devdex.com> writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #7

P: n/a

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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.