Digital Point Forums
Winn Law Group

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Jul 30th 2005, 11:13 am
Mighty Mike Mighty Mike is offline
Peon
 
Join Date: Jun 2005
Location: Postbox Games
Posts: 5
Mighty Mike is an unknown quantity at this point
Unhappy Validating a piece of script.. ish

Hi

Not sure if this is the correct thread to post this in but here goes.

I am trying to validate a website and have come stuck with a piece of code

Code:
<script language="javascript" type="text/javascript"><!--
           document.write('<a href="javascript:popupImage(\'<?php echo $extraImagePopupURL; ?>\',\'<?php echo $extraImagePopupHeight; ?>\',\'<?php echo $extraImagePopupWidth; ?>\');"><?php echo $extraImagePopupImage; ?><br /><span class="enlarge"><?php echo $extraImageURLText; ?></span></a>');
         //--></script>
W3C gives me an error "end tag for element "SPAN" which is not open" & "end tag for element "A" which is not open" to me it looks fine but it might be all the php code in there aswell.

Any pointers greatly appreciated

Thanks

Mike
Reply With Quote
  #2  
Old Jul 30th 2005, 12:26 pm
J.D. J.D. is offline
of the Nightfall
 
Join Date: Nov 2004
Posts: 1,198
J.D. has a spectacular aura aboutJ.D. has a spectacular aura about
* W3 validator shouldn't even see your PHP code.

* Why do you even need document.write if you have PHP and pass static values to document.write?

* Don't aleternate quotes in JS - it's confusing and will lead to errors. Just quote the inner quotes (e.g. document.write("<a href=\"link\">anchor</a>");)

* It will be less code if you use <?= ?> instead of echo (e.g. <?= $extraImagePopupURL ?>)

J.D.
Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How long is a piece of string? Lucky Bastard Directories 7 Jun 16th 2005 6:37 am
Another piece of the jigsaw. Michael Yahoo 5 May 17th 2005 8:53 am
Another site not validating since script update. neterslandreau Setup / Validation Help 7 Apr 3rd 2005 12:10 pm
Script for auto-validating many pages miko67 PHP 4 Apr 3rd 2005 8:30 am
Script for checking / validating recip links? Starbug Link Development 13 Mar 5th 2005 11:22 am


All times are GMT -8. The time now is 6:57 pm.