473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

firefox question

looking for insight on how to make this javascript solution firefox compatible.

http://www.codeproject.com/useritems...xedHeaders.asp

any tips / insight would be helpful

Jun 27 '06 #1
3 2281
Jon Paal wrote:
looking for insight on how to make this javascript solution firefox compatible.

http://www.codeproject.com/useritems...xedHeaders.asp

any tips / insight would be helpful


It falls over in Firefox at this line:

var headerRow = divContent.childNodes[0].childNodes[0].childNodes[0];
Navigating down the dom tree using childNode references is doomed to
fail in most cases, as some browsers (e.g. Firefox) include text nodes
for whitespace that others (e.g. IE) don't. The required element may
be childNodes[0] in IE but will likely be childNodes[1] in Firefox (and
other Gecko-based browsers). I'll guess that the expected sequence is:

divContent -> table -> tbody -> row

If such navigation is necessary, it is better to use:

var headerRow = divContent.getElementsByTagName('someTag')[0]...

to skip unwanted nodes. I'll take a punt that in this case:

var headerRow = divContent.getElementsByTagName('table')[0].rows[0];

or even:

var headerRow = divContent.getElementsByTagName('tr')[0];

will do the job. You may need to fix it elsewhere too.

You may want to write a function that gets a particular instance of a
certain childNode type: getChild(<element>, <nodeName>, <index>) so
you might have something like (pure guesswork here):

var headerRow = getChild(
getChild(divContent, 'table', 0), 'tr', 0);

or

var headerRow = getChild(divContent, 'table', 0).rows[0];
It is also a good idea in IE too, as someone may introduce a node that
the script isn't expecting. You could also get the childNodes
collection and skip across the siblings looking for a particular
instance of a certain node type.

There is a script that does a similar thing here (don't expect any help
though):

<URL:http://www.litotes.demon.co.uk/example_scripts/tableScroll.html>
PS. Removing any whitespace in the source HTML between tags navigated
using childNodes may fix the issue with no change to the script.

--
Rob

Jun 28 '06 #2
thank you!

I've seen the other, and I know folks here can be real assholes about giving any help on it.


"RobG" <rg***@iinet.net.au> wrote in message news:11**********************@m73g2000cwd.googlegr oups.com...
Jon Paal wrote:
looking for insight on how to make this javascript solution firefox compatible.

http://www.codeproject.com/useritems...xedHeaders.asp

any tips / insight would be helpful


It falls over in Firefox at this line:

var headerRow = divContent.childNodes[0].childNodes[0].childNodes[0];
Navigating down the dom tree using childNode references is doomed to
fail in most cases, as some browsers (e.g. Firefox) include text nodes
for whitespace that others (e.g. IE) don't. The required element may
be childNodes[0] in IE but will likely be childNodes[1] in Firefox (and
other Gecko-based browsers). I'll guess that the expected sequence is:

divContent -> table -> tbody -> row

If such navigation is necessary, it is better to use:

var headerRow = divContent.getElementsByTagName('someTag')[0]...

to skip unwanted nodes. I'll take a punt that in this case:

var headerRow = divContent.getElementsByTagName('table')[0].rows[0];

or even:

var headerRow = divContent.getElementsByTagName('tr')[0];

will do the job. You may need to fix it elsewhere too.

You may want to write a function that gets a particular instance of a
certain childNode type: getChild(<element>, <nodeName>, <index>) so
you might have something like (pure guesswork here):

var headerRow = getChild(
getChild(divContent, 'table', 0), 'tr', 0);

or

var headerRow = getChild(divContent, 'table', 0).rows[0];
It is also a good idea in IE too, as someone may introduce a node that
the script isn't expecting. You could also get the childNodes
collection and skip across the siblings looking for a particular
instance of a certain node type.

There is a script that does a similar thing here (don't expect any help
though):

<URL:http://www.litotes.demon.co.uk/example_scripts/tableScroll.html>
PS. Removing any whitespace in the source HTML between tags navigated
using childNodes may fix the issue with no change to the script.

--
Rob

Jun 28 '06 #3
Jon Paal wrote:
thank you!

I've seen the other, and I know folks here can be real assholes about giving any help on it.


Please don't top post, reply below trimmed quotes.

You won't get help on Richard's example here because he's said that he
published it as an example and doesn't want to provide help in regard to it.

I won't provide help on it because the effort is far beyond what I am
prepared to offer. It is an interesting example, but I have no
practical use for it.

I think others feel the same, I can't see how that makes us all a bunch
of arseholes.
--
Rob
Jun 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: B Wooster | last post by:
There is a page that shows Firefox 1.0 render text differently for CSS as compared to FONT FACE for one particular font: http://www.aczoom.com/fonts/xdvng.ttf is the font that does not work. ...
2
by: anna | last post by:
Firefox Mozilla Browser Fonts / Format / rich text / webmail question I have Comcast. They do not support Firefox so they won't help me. When I use Mozilla firefox browser to access my web...
5
by: Prophet | last post by:
Might be a stupid question...... but I keep seeing people post about firefox. What is firefox?
4
by: Greg Burns | last post by:
I think I already know the answer to this, but I'll ask anyways. If I uncheck anonymous access and check Integrated Windows authentication (an intranet webapp), is there anyway to not have the...
3
by: ~~~ .NET Ed ~~~ | last post by:
This is a strange problem and I wonder if anybody has experienced this annoying anomaly. I created a new ASP.NET project with its web-shared directory on my WinXP Pro/IIS machine. I compile the...
8
by: Peter Oliphant | last post by:
I use Firefox as my browser. As a result, I'm banned from getting Windows Updates. This seems a bit monopolistic on MS's part, and it means if there is a security problem or a VS C++.NET 2005 patch...
4
by: drew197 | last post by:
I am a newbie. I am editing someone elses code to make it compatible with Firefox and Safari. In IE, when you click on the proper link, a block of text is shown in a nice paragraph form. But, in...
8
by: pamelafluente | last post by:
Hi, I am invoking Firefox, and for testing IE, from my VB program. The instruction are of this kind: Process.Start("IExplore.exe", Parameter) Process.Start("Firefox.exe", Parameter) where...
12
by: amit | last post by:
Hello group, I'm kinda skeptical about a code is being used in my js program. All it does is checking what browser is being run and finds out if FLASH is installed or not. This code works...
4
by: simon.a.hulbert | last post by:
Hi, I'm trying to view the following xslt transformation using firefox <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output method = "xml" indent =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.