SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Syntax Error?

  1. #1
    SitePoint Member lisamariexo's Avatar
    Join Date
    Aug 2012
    Location
    England
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Syntax Error?

    can someone please explain to me why a syntax error is appearing here?
    35hlls7.png

    thanks
    Attached Images Attached Images

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,594
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    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.
    Last edited by ralph.m; Aug 14, 2012 at 04:24.

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    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.

    Off Topic:

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

  4. #4
    SitePoint Member lisamariexo's Avatar
    Join Date
    Aug 2012
    Location
    England
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <!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/crea...y-sliders.html
    Last edited by Stevie D; Aug 14, 2012 at 06:20. Reason: [HTML] code tags added

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,594
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Try this:

    Code:
    <!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, 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.

  6. #6
    SitePoint Member lisamariexo's Avatar
    Join Date
    Aug 2012
    Location
    England
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is the page im working on http://ln-backups.co.uk/lisa/website/my-work.php

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,594
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    A quick check with the validator—or even looking at the source code—would show you waht's wrong:

    Code:
    <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>
    </head>
    
    <body>
    I suspect you've got the wrong code inside your header.php file that's included on the page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •