Errors prevent inline javascript from starting

I have a service in which users paste javascript code into their website, in the body tag. Sometimes the page on which the code is embedded produces a javascript error from other javascript files that prevent our script from running.

Is there a way to develop our code so that it does not interfere with other areas of javascript.

The only solution I can think of is to put js code in an iframe.

+4
source share
1 answer

The best way to make sure your code always works is to always load it first.

, , . , .

, script , HTML.

script, , javascript , , .

, , script HTML, , .

: http://docstore.mik.ua/orelly/webprog/jscript/ch12_03.htm

+2

Source: https://habr.com/ru/post/1653327/


All Articles