user3564495 user3564495 - 4 years ago 324
Javascript Question

Error parsing XML, line 337, column 62: The reference to entity "appId" must end with the ';' delimiter

Am trying to add facebook login to my website using javascript SDK.

<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&appId=1502856099942926&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>


When I add the above code and save it to my website code, am getting the error:
Error parsing XML, line 337, column 62: The reference to entity "appId" must end with the ';' delimiter.

How to get rid of this error?

Answer Source

Try this

<script>
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src =     &quot;//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;appId=1502856099942926&amp;version=v2.0&quot;;
  fjs.parentNode.insertBefore(js, fjs);
    }(document, &#039;script&#039;, &#039;facebook-jssdk&#039;));
</script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download