469,352 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

using javascript in .xhtml file

I am trying to combine using MathML and javascript in the same page,
running under Firefox 1.5.

I needed to have it called index.xhtml, as it seems to make a
difference for the MathML part, but, when I do this, scriptaculous is
not available.

Here is what I do for the beginning of my document, and I am curious
what I need to do to get this to work.

Thank you.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
/>
<script type="text/javascript" src="prototype.js"></script>
<script src="scriptaculous.js" type="text/javascript"></script>

May 17 '06 #1
5 1227
James Black wrote:
I needed to have it called index.xhtml, as it seems to make a
difference for the MathML part
On the WWW the filename is irrelevent, you need to send the document with an
application/xhtml+xml content-type (although most servers will send that
content type for files with a .xhtml extension).
, but, when I do this, scriptaculous is not available.
There are a number of differences with JavaScript support in XHTML
documents, they are described in the Mozilla XHTML FAQ:

http://www.mozilla.org/docs/web-deve...html#xhtmldiff

I would expect one of these to be the cause of your problem, but I don't
know my way around the internals of scriptaculous and prototype.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
/>


This should not appear in XHTML documents served as application/xhtml+xml.
http://www.w3.org/TR/xhtml1/#C_9

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 17 '06 #2
Thank you for your response, I will make the changes tonight.

May 17 '06 #3
David Dorward wrote:
James Black wrote:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
/>


This should not appear in XHTML documents served as application/xhtml+xml.
http://www.w3.org/TR/xhtml1/#C_9


If you read anything in C.9 as SHOULD NOT (recommendation against), you need
(new) glasses. It states:

| In order to portably present documents with specific character encodings,
| the best approach is to ensure that the web server provides the correct
| headers. If this is not possible, a document that wants to set its
| character encoding explicitly must include both the XML declaration an
^^^^
| encoding declaration and a meta http-equiv statement (e.g., <meta
| http-equiv="Content-type" content="text/html; charset=EUC-JP" />).
PointedEars
May 22 '06 #4

David Dorward wrote:
I would expect one of these to be the cause of your problem, but I don't
know my way around the internals of scriptaculous and prototype.


The scriptaculous problem was that it uses document.write, so I
changed that, and got it working.

May 22 '06 #5
Thomas 'PointedEars' Lahn wrote:
If you read anything in C.9 as SHOULD NOT (recommendation against), you
need (new) glasses.


Drat, I missed that. Blame it a combination of being incredibly frustrated
with the specs indecision and buck passing when it comes to Appendix C and
the assumption that writing an XHTML with the intention of never serving it
as anything but text/html as being stupid.

If a document is to be served as multiple media types, the HTTP server
must be used to set the encoding of the document.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mike Kamermans | last post: by
7 posts views Thread by Trvl Orm | last post: by
3 posts views Thread by Frank | last post: by
83 posts views Thread by liketofindoutwhy | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.