Home >Web Front-end >JS Tutorial >Unsafe common js writing methods_javascript skills

Unsafe common js writing methods_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:46:221034browse
Copy code The code is as follows:

document.write('');


Until the anti-virus software prompts that there is malicious The code found out that this is also unsafe, sweat...

Then I had to change it to this:
Copy code The code is as follows:

(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'http://a.com.cn/b.js';
document.getElementsByTagName('head')[0].appendChild(s);
})();
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn