473,407 Members | 2,359 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,407 software developers and data experts.

xhtml 1.0 strict with javascript

Hello,
I want to validate my simple page with xhtml 1.0 strict. But i want to
use javasript inside. When i try the validator the answer is:

Error:
# Line 33, column 39: there is no attribute "onClick"
<a href="http://www.marca.com" onClick="newwindow();return false">Click
Here!<..

newwindow is a function.

How can i use javascript inside xhtml 1.0 using for example onClick or
onMouseover with a valid xhtml 1.0?.

My Doctype is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

Waiting for your feedback.

--
Sergio del Amo.

Jul 20 '05 #1
5 6621
On Wed, 15 Oct 2003 12:59:34 +0200, Sergio del Amo Caballero
<se***@sbox.tugraz.at> wrote:
I want to validate my simple page with xhtml 1.0 strict.


Why use XHTML 1.0 strict, so few browsers support this, HTML 4.01
strict is much more supported, I'd recommend switching to that - tidy
will automate it for you.

(or alternatively you can read the actual xhtml documentation and note
that attributes are all lower case)

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
Sergio del Amo Caballero wrote:
Error:
# Line 33, column 39: there is no attribute "onClick"
<a href="http://www.marca.com" onClick="newwindow();return false">Click
Here!<..


Weird... i've got this in my XHTML 1.0 Strict page...

<a href="#" onclick="someFunction();">click here</a>

.... and it validates perfect. Try that?

bengee

Jul 20 '05 #3
Thanks for the feedback, i proved in lower case and validate perfectly.

Jul 20 '05 #4
Sergio del Amo Caballero wrote:
Thanks for the feedback, i proved in lower case and validate perfectly.


That sounds right. I read somewhere that all XHTML tags and elements
need to be in lowercase.

bengee

Jul 20 '05 #5
in XHTML all the javascript events should be in lower case, i.e.: onclick,
onmouseover, onblur etcetera

"Sergio del Amo Caballero" <se***@sbox.tugraz.at> wrote in message
news:3f***********************@aconews.univie.ac.a t...
Hello,
I want to validate my simple page with xhtml 1.0 strict. But i want to
use javasript inside. When i try the validator the answer is:

Error:
# Line 33, column 39: there is no attribute "onClick"
<a href="http://www.marca.com" onClick="newwindow();return false">Click
Here!<..

newwindow is a function.

How can i use javascript inside xhtml 1.0 using for example onClick or
onMouseover with a valid xhtml 1.0?.

My Doctype is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

Waiting for your feedback.

--
Sergio del Amo.

Jul 20 '05 #6

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

Similar topics

1
by: Gordon - Adelphia | last post by:
I have a question regarding xhtml. Why, why, why does the ELEMENT <body> allow “unblocked” text. HTML does not (though, most browsers will render). Xhtml (transitional) however allows text nodes...
10
by: mike | last post by:
regards: I use Jtidy (api) to translate a HTML file into a "XHTML file". But The "XHTML file" cannot be identified by nokia 6600. Do I miss something important? Or this is Jtidy's weakness or...
6
by: Jonny | last post by:
How can you validate Javascript generated HTML for XHTML 1.0 strict compliance? To avoid the "<" and "&" problem, all inline scripts MUST be enclosed with either: <!-- script --> Looked down...
2
by: Brian Idzik | last post by:
I've successfully setup a xhtml 1.0 strict page with Mozilla & Netscape to display links in a toolbar into an internal <div id='content'> within the same document. The toolbar uses some...
7
by: Paul Marsh | last post by:
Hello everyone, I am attempting to create a xhtml page that uses a bit of dhtml. The javascript I am using uses document.getElementById('someId').style.someProperty; and is and external script....
7
by: Simon Strandgaard | last post by:
There are no <iframe> tag in xhtml strict, instead I should use <object>. If I change <iframe> to <object> then my javascript stops working. I am curious to how to use <object> with javascript...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.