Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    592
    Thanks
    0
    Thanked 1 Time in 1 Post

    Firefox does't understand our own tags

    Hi all

    Code:
    
    <?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 ?

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,519
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Well without seeing the JS you used we don't know why it wasn't working but this works
    Code:
    <?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>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Code:
    <myplace id="img3" isThere="yes" />
    contains upper case characters.

    Kind regards,

    Gary

  • #5
    New to the CF scene
    Join Date
    Jul 2006
    Location
    Warsaw, Poland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •