Syntax Error?

can someone please explain to me why a syntax error is appearing here?

thanks

It’s hard to say for sure, but the script code on line 22 is a bit of a mess, so try cleaning that up first.

If that doesn’t help, paste your code into the w3c validator.

I find the images are too hard to follow; it would have been better if you had copy-and-pasted the code sample here then I could have told you straight-away.

What I can tell you is the IMG elements aren’t closed correctly and the SCRIPT element is completely mangled. Other than that I’d need to see the code sample itself to make sense of what is going on so please post the sample code in the forum if you cannot figure out the validator results yourself. :slight_smile:

Off Topic:

@ralph_m; How about this for : “Spot the Error” Competition 3? An image to work from that really would be devious. >;-)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<link href="style-portfolio.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"> var _siteRoot='index.html',_root='index.html'; </script>
	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/scripts.js"></script>

<?php include("includes/header.php")?>
</head>

<body>
<div id="header"><div class="wrap">
  <div id="slide-holder"><div id="slide-runner"><a href=""><img id="slide-img-1" src="images/nature-photo.png" class="slide" alt=""></a>
		<a href=""><img id="slide-img-2" src="images/switzerland.jpg" class="slide" alt=""></a>
		<a href=""><img id="slide-img-3" src="images/switzerland2.png" class="slide" alt=""></a>
		<a href=""><img id="slide-img-4" src="images/switzerland3.png" class="slide" alt=""></a>
		<a href=""><img id="slide-img-5" src="images/switzerland4.png" class="slide" alt=""></a>
		<a href=""><img id="slide-img-6" src="images/nature-photo4.png" class="slide" alt=""></a>
		<a href=""><img id="slide-img-7" src="images/nature-photo6.png" class="slide" alt=""></a>
<div id="slide-controls"><p id="slide-client" class="text"><strong>post: </strong><span></span></p><p id="slide-desc" class="text"></p><p id="slide-nav"></p></div></div></div></div></div>
<script type=" text=" "="" javascript="">
if(!window.slider) var slider={};slider.data=[{"id":"slide-img-1","client":"nature beauty","desc":"nature beauty photography"},{"id":"slide-img-2","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-3","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-4","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-5","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-6","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-7","client":"nature beauty","desc":"add your description here"}];
</script>

<?php include("includes/footer.php")?>
</body>
</html>

also the script code is what im trying to insert this slider from here: http://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html

Try this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<link href="style-portfolio.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"> var _siteRoot='index.html',_root='index.html'; </script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>

<?php include("includes/header.php")?>
</head>

<body>
<div id="header"><div class="wrap">
<div id="slide-holder"><div id="slide-runner"><a href=""><img id="slide-img-1" src="images/nature-photo.png" class="slide" alt=""></a>
<a href=""><img id="slide-img-2" src="images/switzerland.jpg" class="slide" alt=""></a>
<a href=""><img id="slide-img-3" src="images/switzerland2.png" class="slide" alt=""></a>
<a href=""><img id="slide-img-4" src="images/switzerland3.png" class="slide" alt=""></a>
<a href=""><img id="slide-img-5" src="images/switzerland4.png" class="slide" alt=""></a>
<a href=""><img id="slide-img-6" src="images/nature-photo4.png" class="slide" alt=""></a>
<a href=""><img id="slide-img-7" src="images/nature-photo6.png" class="slide" alt=""></a>
<div id="slide-controls"><p id="slide-client" class="text"><strong>post: </strong><span></span></p><p id="slide-desc" class="text"></p><p id="slide-nav"></p></div></div></div></div></div>
[COLOR="#FF0000"]<script type="text/javascript">[/COLOR]
if(!window.slider) var slider={};slider.data=[{"id":"slide-img-1","client":"nature beauty","desc":"nature beauty photography"},{"id":"slide-img-2","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-3","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-4","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-5","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-6","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-7","client":"nature beauty","desc":"add your description here"}];
</script>

<?php include("includes/footer.php")?>
</body>
</html>

Also, as xhtmlcoder said, with the doctype you have, your are meant to close image elements with />

In terms of validating the HTML, get the page to render in the browser first so you can view the actual rendered HTML without the PHP bits.

this is the page im working on http://ln-backups.co.uk/lisa/website/my-work.php

A quick check with the validator—or even looking at the source code—would show you waht’s wrong:

<body>
<div id="header_wrap">
<div id="header">
<div id="site_logo"></div>
</div>
</div>

<div id="menu_wrap">
<div id="menu">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="about-me.php">About Me</a></li>
<li><a href="my-work.php">My Work</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
</div>
[COLOR="#FF0000"]</head>

<body>[/COLOR]

I suspect you’ve got the wrong code inside your header.php file that’s included on the page.