I've recently converted to includes PHP everything works OK but today I decided to validate one of my pages at site level and I found there are errors, but when I checked them on D W all the pages are OK, then I looked at the includes individually and found they all have errors, is this a problem and if so what can I do about it, can any one help please, thank you Jeff Lane
All that matters to the validator is the resultant code (as seen in browser View Source) after the includes have been processed on the server.
The includes are pre-processed on the server individually then the page is stitched together from the component parts by the server to form a single valid page. Then it's delivered to the browser - and that's what the validator sees.
Can you post a link to a page that concerns you?
Include files should only contain snippets of relevant code.
Example include for a menu.
<div id="menu">
<ul>
<li>menu item</li>
<li>menu item</li>
<li>menu item</li>
</ul>
</div>
They should NOT contain tags that already occur in parent pages such as <html>, <head> or <scripts> unless you're using includes for those as well.
For better answers, we would need to see your parent page code and your include code.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
Jeffrey54 Lane wrote:
I looked at the includes individually and found they all have errors, is this a problem and if so what can I do about it
Some "errors" are simple noncompliance with W3C standards, and others can affect page performance in some or all browsers/devices. Thus it's best to repar them.
What I do is open the page from the server, and save a copy as HTML only.
Then I run the page through the W3C validator to view the errors .
I open the saved page in DW and repair the errors in the "include" sections of the page and save it.
Finally, I transfer the corrections to my include file and upload it.
Hi sorry for the lack of information, below is my site URL, when I do a W3C validation on my pages individually in Dreamweaver they come up clean, and they work with no problems, but when I login to the web site and do a W3C validation from there, this is obviously when they are connected to the includes files they show approximately 11 errors this varies depending on what page I am on, so I go back to Dreamweaver, I then open one of my include files the example below is telephone.php I do a W3C validation on it by its self and it comes up with lots of problems, and there are errors on all of the includes files.
Thank you for your help Jeff Lane
www.thecarpetandflooringconsultant.co.uk •[Top of page | #pagetop] •[Contact Us | contact.php] Tweet
</p
Where you see the below validation error it means you have not declared - type="text/javascript" in the <script> tag.
So this:
<script>(function(d, s, id) {
Should be:
<script type="text/javascript">(function(d, s, id) {
The rest of the errors appear to be associated with 'twitter' and 'facebook' button code so I would forget those.
Better to validate the page as a whole.
The W3C validator picks up 11 HTML errors on your home page.
Most of them come from Facebook like and Twitter share buttons.
On line 413, a misplaced </p> tag.
That's about it. No major stuff I can see.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
Hi its Jeff again I’ve done what Osgood said but new it says there’s a Syntax error on line 4 I really don’t know lot if any think about java script so I’m a bit stuck here. I have put the numbers 1 to 8 just so you know which line I am talking about. Thanks Jeff
1.
2.
3. var js, fjs = d.getElementsByTagName(s)[0];
4. if (d.getElementById(id)) return;
5. js = d.createElement(s); js.id = id;
6. js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
7. fjs.parentNode.insertBefore(js, fjs);
8. }(document, 'script', 'facebook-jssdk'));</script
Hi I have sorted that last problem out I just misunderstood what Osgood said, carrying on from that same prob different part, what you see below is the source of most of my problems it is saying that the “ is wrong but what can I use instead. Thanks Jeff
W3C Validation
Description: Error Line 410, Column 248: there is no attribute "data-url"
…class="twitter-share-button" data-url="http://www.thecarpetandflooringconsulta…
Tweet</a
Almost all the marketing people tell you to use Facebook and twitter to enhance you marketing and make the most of it, only thing is I wouldn’t use it if I were you because their buttons are a load of crap, surely they would have picked up on this by now and done something about it, wouldn’t have they? Jeff Lane
Jeffrey54 Lane wrote:
W3C Validation
Description: Error Line 410, Column 248: there is no attribute "data-url"
…class="twitter-share-button" data-url="http://www.thecarpetandflooringconsulta…
Tweet</a
The problem lies with your doctype. The data-url attribute is valid in HTML5 only.
Jeffrey54 Lane wrote:
Almost all the marketing people tell you to use Facebook and twitter to enhance you marketing and make the most of it, only thing is I wouldn’t use it if I were you because their buttons are a load of crap, surely they would have picked up on this by now and done something about it, wouldn’t have they? Jeff Lane
I think you're making a mountain out of a mole hill. I would not worry too much about getting your page to validate 100%, waste of production time. The errors on your page will make no difference to performace, display or anything else for that matter. The art is knowing when to move on, validation means nothing, no guarantee of anything, certainly not to be relied on as a measure of if the page will display cross-browser, not even that you have wrtten 'economical' code.
North America
Europe, Middle East and Africa
Asia Pacific