2

I keep getting this error: Error at line 5, character 2: Parse error. primary expression expected

This is what the custom HTML looks like:

<script type="text/javascript">

//paste your Tawk embed code here, without Script tags

<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/5a2863145d3202175d9b6c41/default';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>

Can anyone help me out?

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
  • You seem to have a double script tag open. Could you clarify or post a bit more of your HTML? – mkey Nov 30 '18 at 21:02

1 Answers1

0

You have a second <script> tag inside your original code, which is invalid. It should look like this:

<script type="text/javascript">

    //paste your Tawk embed code here, without Script tags

    var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
    (function(){
    var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
    s1.async=true;
    s1.src='https://embed.tawk.to/5a2863145d3202175d9b6c41/default';
    s1.charset='UTF-8';
    s1.setAttribute('crossorigin','*');
    s0.parentNode.insertBefore(s1,s0);
    })();

</script>
Jack Bashford
  • 43,180
  • 11
  • 50
  • 79