Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML1506: Unexpected token <script>

I have an error that only appears in Internet Explorer and Edge where I am getting HTML1506: Unexpected token in line 213,1. My suspicion is that it has to do with the way my webcomponents/polyfills are loading, but at this point it's a pretty complicated web of components and scripts, so narrowing down the source is a pain!

Here is the code segment containing line 213:

210 </body>
211 </html>
212
213 <script>
214 /********************************
215 /TEMPLATE VARS
216 /*******************************/
217 var save_url = '';  
218 var base_url = 'http://disalle.dev.activemls.com/';

live site: http://disalle.dev.activemls.com

like image 502
Destination Designs Avatar asked Sep 14 '15 14:09

Destination Designs


2 Answers

At first glance, it looks like you have you scripts after your closing HTML document.

Try:

</body>
<script>
/********************************
/TEMPLATE VARS
/*******************************/
var save_url = '';  
var base_url = 'http://disalle.dev.activemls.com/';
// More Stuff Here
</script>
</html>
like image 69
TbWill4321 Avatar answered Oct 17 '22 00:10

TbWill4321


To avoid this error in Internet Explorer, place the script at the end of the <body> tag:

 <body>
    
    // more
   
    <script>
    /********************************
    /TEMPLATE VARS
    /*******************************/
    var save_url = '';  
    var base_url = 'http://disalle.dev.activemls.com/';

    // more

    </script>
</body>
</html>
like image 1
Super Jade Avatar answered Oct 16 '22 23:10

Super Jade