Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get page to validate - any ideas? 2

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
Hello,

Using CSS so posting here but ?Javascrfipt problem (or just a simple html problem I am too dumb to solve?)

All of my HTML validates as XHTML strict except a small javascript line to open a new window when an image link is clicked.

THis line generates the following error:

Line 66, column 37: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

^
Line 66, column 59: an attribute value must be a literal unless it contains only name characters (explain...)
^

The offending line of code is:

<span style=&quot;cursor:pointer&quot; onclick=javascript:window.open(&quot;ecgimages/page01/page01large.html&quot;,&quot;blank&quot;,&quot;toolbar=no,width=806,height=658,left=150,top=0&quot;)><img src=&quot;ecgimages/page01/page01small.gif&quot; height=&quot;300&quot; width=&quot;400&quot; alt=&quot;An example of an ecg&quot; class=&quot;right&quot; /></span>

The header to my page is as follows:

<!DOCTYPE html
PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
&quot;
<html xmlns=&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;>

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

Can paste the full page if needed. Not uploaded yet.

Any ideas how I can get this line of Javascript to validate?

All help much appreciated.

JDN
 
XHTML must ve valid xml. Valid xml must have all attributes enclosed in double quotes &quot;&quot;. Your onclick handler doesn't have quotes and therefore is not a 'literal' by XML standards.

Try:
[tt]
<span style=&quot;cursor:pointer&quot; onclick=&quot;javascript:window.open('ecgimages/page01/page01large.html','blank','toolbar=no,width=806,height=658,left=150,top=0')&quot;><img src=&quot;ecgimages/page01/page01small.gif&quot; height=&quot;300&quot; width=&quot;400&quot; alt=&quot;An example of an ecg&quot; class=&quot;right&quot; /></span>[/tt]

 
The head of the nail has been hit!

Thanks for the speedy helpful response.

Star on its way.

JDN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top