473,507 Members | 8,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1323
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
15039
by: Mike Kamermans | last post by:
I'm trying to determine where inside an XHTML's DOM a javascript function is triggered, but when I use the construction of calling a function with "this" as parameter and then checking the event...
7
1958
by: Trvl Orm | last post by:
I am working with 2 frames, Left and Right and the main code is in the left frame, which has been attached. Can someone please help me with this code. I am new to JavaScript and can't figure it...
3
10728
by: jason | last post by:
I have a very simple asp.net 2.0 page with one textbox that onkeyPress is suppose to do some check of what was typed. Below is the source showing the javascript function is available. The minute I...
3
20885
by: Frank | last post by:
Hi, I simply wish to code a JS function ONCE, in a .js file, include the .js file in the Master page, and then in several but not all pages, I wish to execute the function on pageload. I...
3
3443
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
1
1978
by: mohkb | last post by:
If i run my javascript withen html using dreamweaver, it works perfectly well. But when i try to use 'src' command to run the script from another file it doesnt work. Can anybody tell me why. and...
5
1349
by: dbsmilr | last post by:
This is what I want to do: <html> <xml id="myXml"> <book title="book1" /> <book title="book2" /> </xml> <div id="out"><!-- I would output the xml formatted nicely for the user in this...
83
4111
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
1
3427
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.