w3c Validation error message - Facebook widget

耗尽温柔 提交于 2019-12-24 13:41:57

问题


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…

回答1:


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



来源:https://stackoverflow.com/questions/13529363/w3c-validation-error-message-facebook-widget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!