Home  >  Article  >  Web Front-end  >  Small discovery of js implementation method for Flash activation box not appearing in IE_javascript skills

Small discovery of js implementation method for Flash activation box not appearing in IE_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:09:12953browse

Everyone knows that the method to deceive IE not to display the Flash activation box is very simple. Just introduce a js file on the page, and then use js to control the html code output of flash. But if our script is dynamically loaded, there will be two situations. See the following code


Program code
var s = docuemnt.createElement("script");
s. src = src;
docuemnt.getElementsByTagName("head")[0].appendChild(s);



Program code
var s = docuemnt.createElement("script ");
docuemnt.getElementsByTagName("head")[0].appendChild(s);
s.src = src;


Look at the execution results of these two pieces of code at a glance Pretty much the same as above. However, there is a piece of code that cannot fool IE. The imported js output flash will display an activation box.

The only difference between these two steps is to first assign a value to the src of the script object and then append to the head. Or append first and then assign. I did an experiment and found that IE can be deceived by first assigning a value to the src of the script and then appending it to the page.​

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