Why does Google Visualization Cause HTML1504 Unexpected End Tag Errors?

Can someone explain why I get the HTML1504: Unexpected end tag warning when using the Google visualization API to display a chart?

I was debugging a website where the chart rendered fine in Firefox but didn't display any data in IE11. In the end, I fixed the problem (incorrect date format, which IE11 handled differently for Firefox), but spent a lot of time trying to track the above error.

My code is based on the code example https://developers.google.com/chart/interactive/docs/quick_start , which gives the same message. Nothing untimely appears in either JSLint or the W3C HTML Validator.

The warning disappears if I comment on the line google.load('visualization', '1.0', {'packages':['corechart']}); , but this will clearly stop the chart. Changing IE11 compatibility settings had no effect.

The error appears in the IE11 Developer Console, but nothing looks like the console console, browser console, or Firebug in Firefox. IE11 reports an error caused by the </script> at the end of my chart code (this is embedded javascript, not a separate file). Removing the </script> causes HTML errors (as expected!)

I am intrigued by the fact that calling a function in Javascript should be able to throw an error in the surrounding HTML. Does a warning mean? Can this be avoided?

+7
javascript html internet-explorer google-visualization charts
source share
1 answer

I had the same problem on MS Edge + Win 10. No warnings with the new bootloader:

 <!DOCTYPE html><html><head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['corechart']}); </script> </head> <body></body> </html> 

Google Maps downloaded by jsapi is no longer updated if absolutely necessary.

0
source share

All Articles