Monday, May 20, 2024
145
rated 0 times [  146] [ 1]  / answers: 1 / hits: 36037  / 10 Years ago, thu, june 5, 2014, 12:00:00

I'm fairly new to this, so sorry if this is a simple question.



I'm trying to install the FB like box onto my website www.thehungryeurasian.com



However, when I try inserting the Javascript SDK:



<div id=fb-root></div>
<script>(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/sdk.js#xfbml=1&version=v2.0;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


The following error comes up:



Error parsing XML, line 884, column 64:
The reference to entity version must end with the ';' delimiter.

More From » facebook-like

 Answers
4

It looks like something is interpreting your document as XML rather than HTML. XML is much stricter than HTML - one of the rules is that ampersands (&) have a special meaning. They mean here comes an XML entity, which is a special character. For instance, you can type &quot; to insert , or &gt; to insert > into your document.



In this case, your code is interpreting &version on line 6 as the start of one of these entities. If you update line 6 as follows:



js.src = //connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.0;


Then you should find that error disappears.


[#70697] Wednesday, June 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shaina

Total Points: 161
Total Questions: 99
Total Answers: 108

Location: American Samoa
Member since Fri, Sep 24, 2021
3 Years ago
;