1.doc ument. createelement
Problem description: When Using ASP. NET, we usually need to register a script, which is usually sent to the client in this form;
<SCRIPT type = "text/JavaScript"> // <! [CDATA [layer. Alert ('Log On first! ',-1,' hint ', function () {location. href ='/login. aspx ';}); //]> </SCRIPT>
However, this script is correct in IE8 and later versions. However, in IE6 and 7, the system prompts "Internet Explorer cannot open the Internet site http: // xxxx/terminated operation ", I checked it online. It turns out that when the page is not complete, if createelement exists in the executed JS, it will cause such a problem. I wrote a jquery plug-in, jquery. layer, which may have createelement operations, so this problem occurs;
Solution: place the script in window. onload or jquery (document). Ready, for example:
<SCRIPT type = "text/JavaScript"> // <! [CDATA [jquery (document). Ready (function () {layer. Alert ('Please log on first! ',-1,' hint ', function () {location. href ='/login. aspx ';}); //]> </SCRIPT>
Or put the script at the bottom of the page? I have not tried this. If you are interested, try it.