SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question One Validation problem left for Javascript

    Hi all,

    My site is at:
    http://www.absolutethree.com/fyp/home.htm

    and the validator output 1 error:

    1. Error Line 53 column 44: end tag for element "DIV" which is not open.

    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV


    The line causing the problem is:
    Code:
    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
    I have read the FAQ but still have problems resolving this error.
    Any help will be appreciated.
    Thank you.

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually it works !
    put some content in your div to see it.
    even if javascript forgive it most of the time, don't forget to put a ';' after each instructions :

    document.write('<div id="dhtmltooltip">hello</div>'); //write out tooltip DIV

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Result:  	 Passed validation
    File:	upload://Form Submission
    Encoding:	utf-8
    Doctype:	XHTML 1.0 Transitional
    Code:
    <!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" 
      xml:lang="en" lang="en">
    <head>
    <title>html and javascript</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Style-Type" content="text/css" /> 
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    
    <script type="text/javascript" language="javascript">
    <!-- Hide from browsers without javascript
    
    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
    
    // End hiding -->
    </script>
    </head>
    <body>
    
    </body>
    </html>

  4. #4
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure why but it just can't validate when its in placed in the javascript

    I have managed to pass the validation by converting it to html code:
    Code:
    <div id="dhtmltooltip"></div>
    Thanks for the help


Bookmarks

Posting Permissions

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