By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

xhtml 1.0 strict with javascript

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
Thanks for the feedback, i proved in lower case and validate perfectly.

Jul 20 '05 #4

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.