Unexpected token error while using javascript snippet with WPCode in wordpress

47 Views Asked by At

I am trying to add custom javascript into my website for a widget on wordpress using the wpcode plugin but I keep getting an unexpected token error. There is a already created that isn't accessible in the text box where you add the code. Here is the line of javascript:

<script src="https://apis.owenscorning.com/client/widget.js" async></script>

I've tried deleting the opening and leaving the "src=" in hopes of it accepting the script that is inaccessible but the unexpected token error doesn't go away.

1

There are 1 best solutions below

0
TResponse On BEST ANSWER

Yes that's the script tag which you would normally place in the <head> tag of your html file. However, that script of you paste that url into the browser you'll see its a self executing widget code. Since that code looks for the head tag on the document etc. I would like to recommend you place that script of code right at the bottom of your <body> closing tag:

E.g.

<body>
 ....[other code here]....
  <script src="https://apis.owenscorning.com/client/widget.js"></script>
</body>