Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Easy Date   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 01-15-2006, 11:55 AM   #1 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
JS not validating????

OK I have a little javascript in a page and this will not pass as XHTML transitional....


Code:
<script> document.write('something<br />something else<br />and a little more...'); </script>
when I go to validate it, it is choking on the <BR /> tag.
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 01-22-2006, 11:42 AM   #2 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
BUMP.... anyone?
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 01:22 PM   #3 (permalink)
Inactive
 
Michael Allison's Avatar
 
Join Date: 12-08-05
Location: Spokane, WA
Posts: 1,961
iTrader: 0 / 0%
Latest Blog:
None

Michael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web pro
Send a message via MSN to Michael Allison Send a message via Yahoo to Michael Allison Send a message via Skype™ to Michael Allison
I have no clue why that doesn't work... JS is not my strong suit, sorry.
Michael Allison is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 04:33 PM   #4 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by Michael Allison
I have no clue why that doesn't work... JS is not my strong suit, sorry.
Thanks for at least having a look. The JS is fine, I just wanted to know what the validators had an issue with it.
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 04:39 PM   #5 (permalink)
Inactive
 
Michael Allison's Avatar
 
Join Date: 12-08-05
Location: Spokane, WA
Posts: 1,961
iTrader: 0 / 0%
Latest Blog:
None

Michael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web proMichael Allison is a highly respected web pro
Send a message via MSN to Michael Allison Send a message via Yahoo to Michael Allison Send a message via Skype™ to Michael Allison
What validator? W3C? Or Tidy?
Michael Allison is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 05:53 PM   #6 (permalink)
v7n Mentor
 
paranoidandroid's Avatar
 
Join Date: 08-29-04
Location: Lancashire UK
Posts: 812
iTrader: 0 / 0%
Latest Blog:
None

paranoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to beholdparanoidandroid is a splendid one to behold
Not sure if this will help but...

I created a page (see code below) with your above code in and ran it through a html tidy app, then tested it at w3c.org and it validates XHTML 1.0 Strict.

As you will see it has altered a few things -

Code:
<?xml version="1.0" encoding="utf-8"?> <!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"> <head> <script type="text/javascript"> //<![CDATA[ document.write('something<br />something else<br />and a little more...'); //]]> </script> <title></title> </head> <body> </body> </html>

let me know if this helps, or if you find out the problem would like to know what was causing it.
paranoidandroid is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 07:04 PM   #7 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by Michael Allison
What validator? W3C? Or Tidy?

I was using W3C and using XHTML transitional
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 07:07 PM   #8 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by paranoidandroid
Not sure if this will help but...

I created a page (see code below) with your above code in and ran it through a html tidy app, then tested it at w3c.org and it validates XHTML 1.0 Strict.

let me know if this helps, or if you find out the problem would like to know what was causing it.
One thing I did not do, I did not have it defined in the head section as you did. I had a condition and needed to print one of two things out in the body. Was thinking about a conversion to PHP, but did not wat to do that.... Call me lazy....
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2006, 09:01 PM   #9 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
paranoidandroid,

Thanks for the info!!! I tried the validation with the script in the head and again in the body section - both passed! Then I removed "//<![CDATA[" tag, it failed! So, I need to find out more on this and it's proper use.

Thanks again!
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2006, 11:32 AM   #10 (permalink)
Inactive
 
Join Date: 01-15-06
Posts: 27
iTrader: 0 / 0%
Latest Blog:
None

Eran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the rough
Use that code, it's working for me:
PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<!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">
<head>

  <script type="text/javascript">
    <!--
    document.write('something<br />something else<br />and a little more...');
    -->
  </script>

  <title></title>
</head>

<body>
</body>
</html>
Eran-s is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2006, 11:58 AM   #11 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Eran-s,

Thanks for the input on this too. I just sent it to the validator, it passed. Sent it again as transitional, it passed. Removed the comment tags after and before the script tags, it FAILED! So, I think we finally figured out why.

Thanks to everyone who helped in solving this!
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2006, 12:07 PM   #12 (permalink)
Inactive
 
Join Date: 01-15-06
Posts: 27
iTrader: 0 / 0%
Latest Blog:
None

Eran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the roughEran-s is a jewel in the rough
No problem,
I will explain why it passed - because the validator see the tags "<!-- -->" and ignore the text on it.

Good luck =]
Eran-s is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 12:06 AM.
© Copyright 2008 V7 Inc