...

View Full Version : Firefox does't understand our own tags



iota
08-14-2006, 02:49 PM
Hi all





<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<myplace id="img3" isThere="yes" />

</body>
</html>


In firefox, if I call img3 with getElemenById, I got "null".
Again I call its "isThere" property I got "undefined".

In IE, there's no problem.

Does my Firefox make me crazy ?

mlseim
08-14-2006, 03:04 PM
I don't quite understand the question ...

Are you defining your own tags ... something like this?
http://www.radpage.com/heitml2.0/tutor/owntags.hei

_Aerospace_Eng_
08-14-2006, 03:09 PM
Well without seeing the JS you used we don't know why it wasn't working but this works

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
window.onload = function()
{
alert(document.getElementById('img3').getAttribute('isThere'));
}
</script>
</head>
<body>
<myplace id="img3" isThere="yes" />
</body>
</html>

Graft-Creative
08-14-2006, 03:16 PM
I'm not really understanding the question either, but (apart from the funny 'myspace' tag?) It could be a conflict between the xml declaration at the top of your code and the fact that the tag
<myplace id="img3" isThere="yes" /> contains upper case characters.

Kind regards,

Gary

mariuszn3
08-15-2006, 01:33 PM
Your tag is not valid XHTML tag (you give XHTML namespace to document and most probably you are sending it as html/text or xml+xhtml/application mime-type)
Therefore it's an errorneus tag which firefox most probably ignores.

jkd
08-15-2006, 04:33 PM
An unknown tag in the XHTML namespace will be initialized as an HTMLUnknownElement in the DOM and treated normally by the DOM tree, as if it were a HTMLSpanElement. Parsing HTMLUnknownElement-tags has some funky behavior, but DOM-wise it's not a big deal at all.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum