473,553 Members | 2,934 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="scriptacul ous.js" type="text/javascript"></script>

May 17 '06 #1
5 1330
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
15043
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 target inside the javascript function, I get very very little love from javascript in an XHTML setting.... I have put up the file that demonstrates my...
7
1967
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 out. What needs to happen is this: On the left frame you should have a series of buttons, which when pushed makes things happen on the right...
3
10732
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 strike a key I get the error. Anybody know why? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
3
20888
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 don't want to use the Page.ClientScript.RegisterStartupScript(this.GetType(),"displaymessage", strScript, false);
3
3451
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 want to extract all the tracks from a specific CD. Right now, im using an array to stock all the data but its just a question of time before...
1
1987
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 what i can do to correct it. Java script withen html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
5
1352
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 div</div>
83
4120
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 it too? Once I saw a website comparing Prototype to Java and jQuery to Ruby... but now that I read more and more about Prototype, it is said...
1
3438
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 have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
7568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7526
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6109
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5133
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1990
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 we have to send another system
1
1106
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.