Search code examples
validationw3c

w3c Validation error message - Facebook widget


I echo a url from xml file

$mapurl = '"../villas-crete.php?adults='.$getadults.'&arrival='.$getarrival.'&departure='.$getdeparture.'&avail='.$getavail.'"';

echo '<a href='.$mapurl.'>&raquo; Crete</a>
    '
    ;

When I validate the page I get following errors:

Line 3182, Column 43: general entity "arrival" not defined and no default entity

…<a href="../villas-crete.php?adults=2&arrival=&departure=&avail=0">&raquo; Cre…

Error Line 3182, Column 50: reference to entity "arrival" for which no system identifier could be generated

…ef="../villas-crete.php?adults=2&arrival=&departure=&avail=0">&raquo; Crete</a>

ang goes on....

Also I have erors for Facebook widget

Widget is:

<script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div class="fb-like-box" data-href="http://www.facebook.com/pages/..mypage" data-width="364" data-show-faces="true" data-stream="false" data-header="true"></div>

there is no attribute "data-href"

<div class="fb-like-box" data-href="http://www.facebook.com/pages/

there is no attribute "data-width"

…-" data-width="364" data-show-faces="true" data-stream…

Solution

  • I had a quick look at: http://validator.w3.org/docs/errors.html

    25: general entity X not defined and no default entity

    This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text.

    325: reference to entity X for which no system identifier could be generated

    This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text.

    Perhaps try replacing those ampersands with &amp; and see how you get on?

    Edit for facebook question: think you need a doctype that supports data-href etc. See: W3C validation error with data-href