Problem with Firefox?

D

Dennis

I am in the process of converting some program output from HTML to
XML/XSLT. I have an XSL stylesheet that inserts some javascript in the
output that gets called further down to pop up a window). It works fine
in IE6 but not in Firefox/Netscape. See...

http://kowallekfamily.com/genealogy/reports/desc-3817.xml

It is the Note link (just to the right of Henry Bales) which is supposed
to pop up a window. In Firefox this link even looks strange (note the
space between the word "Note" and its underscores.

I am not even sure that this is a XML/XSLT problem. But I have a similar
HTML page at...

http://kowallekfamily.com/genealogy/reports/desc-3817.htm

....that works just fine in Firefox. I compared the XSL transform output
to the HTML page and the pop-up code looks virtually identical.

Is this an XML/XSLT problem just with Firefox or should I be looking
elsewhere?

I am using Firefox 2.0.0.14.

TIA,
 
J

Joseph J. Kesselman

Haven't checked, but at a guess it sounds more likely that your
javascript is nonportable...
 
D

Dennis

Haven't checked, but at a guess it sounds more likely that your
javascript is nonportable...

I tried replacing the javascript:history.back(1) [which worked in
Firefox] with javascript:alert('blah') [which did nothing in Firefox].
So, unless I am wrong, it looks like some javascript which works on an
HTML page will not work on XML/XSLT page under Firefox (and Netscape).
 
R

Richard Tobin

Dennis said:
I am in the process of converting some program output from HTML to
XML/XSLT. I have an XSL stylesheet that inserts some javascript in the
output that gets called further down to pop up a window). It works fine
in IE6 but not in Firefox/Netscape. See...

http://kowallekfamily.com/genealogy/reports/desc-3817.xml

It is the Note link (just to the right of Henry Bales) which is supposed
to pop up a window. In Firefox this link even looks strange (note the
space between the word "Note" and its underscores.

Look at the Firefox Error Console. It probably says that NewNote is
not defined. I think this is because you are putting your Javascript
inside a comment. This was common in the days when some browsers
didn't understand <script>, but it makes no sense when you are using
XSL. Probably the browser is just ignoring comments generated by XSL.

(I suspect that IE effectively writes out the result of the transform
as text and then reparses it as an HTML document, while Firefox uses
the result tree directly.)

The space between "Note" and the underline isn't surprising: the word
is inside <sup>. Put the <sup> around the whole <a> if you want the
link itself to be a superscript.

-- Richard
 
D

Dennis

The space between "Note" and the underline isn't surprising: the word
is inside <sup>. Put the <sup> around the whole <a> if you want the
link itself to be a superscript.

Thanks. That fixed one problem ... although <a><sup>...</sup></a> worked
fine in an HTML doc in Firefox. Just another difference between the way
HTML and XML is handled in Firefox.
 
D

Dennis

Look at the Firefox Error Console. It probably says that NewNote is
not defined. I think this is because you are putting your Javascript
inside a comment. This was common in the days when some browsers
didn't understand <script>, but it makes no sense when you are using
XSL. Probably the browser is just ignoring comments generated by XSL.

(I suspect that IE effectively writes out the result of the transform
as text and then reparses it as an HTML document, while Firefox uses
the result tree directly.)

Bingo. Removing the comments did the trick. Thanks!
 
D

Dennis

Haven't checked, but at a guess it sounds more likely that your
javascript is nonportable...

I tried replacing the javascript:history.back(1) [which worked in
Firefox] with javascript:alert('blah') [which did nothing in Firefox].

I just tried creating a small sample to show this behavior and the alert
worked fine. Time to call it quits for the night...
 

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
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top