NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Problem validating javascript with xhtml

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
2 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 07-29-2005, 07:55 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



Problem validating javascript with xhtml - RESOLVED


I have a PHP function where I type in an email address and it will print out a javascript to display my email address to protect it from email harvesters.

The output looks like this:

<script type="text/javascript">
emailAddy='domain.com'
emailAddy=('someperson' + '@' + emailAddy)
document.write('<a href="mailto:' + emailAddy + '">' + emailAddy + '</a>')
</script>

However, when I validate the page at w3.org, I get this error:

Line 57, column 50: document type does not allow element "a" here

document.write('<a href="mailto:' + emailAddy + '">' + emailAddy + '</a>')

I made the greater than sign red because thats what the validator shows me. Any ideas?




EDIT: PROBLEM SOLVED!!!!

????: NamePros.com http://www.namepros.com/programming/111076-problem-validating-javascript-with-xhtml.html
I spent half an hour trying to figure out a solution before I posted it, and of course, 10 minutes after I posted it, I figured it out. I just had to put put the comment tags inside my script

<script type="text/javascript">
<!--
emailAddy='domain.com'
emailAddy=('someperson' + '@' + emailAddy)
document.write('<a href="mailto:' + emailAddy + '">' + emailAddy + '</a>')
-->
</script>
__________________
Joe
Last edited by gamex; 07-29-2005 at 08:06 PM.
gamex is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript problem: undefined variable Shad Programming 3 08-20-2005 04:44 AM
Javascript Problem which is related with the MIME type in Firefox mustafamisir Programming 1 08-01-2005 07:00 PM
Problem with php forms and xhtml! PoorDoggie Programming 2 05-31-2005 12:47 PM
Javascript novice with small problem... martyn187 Programming 2 05-04-2004 06:22 AM
Javascript: W3C Problem? Mp)Tarh Programming 2 11-16-2003 04:26 AM

 
All times are GMT -7. The time now is 12:10 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger