| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Feb 2004 Location: Student @ UConn
Posts: 411
![]() ![]() | 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.
|
| |
![]() |
| 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 |