首页 > 技术文章 > while 循环代码

ymcs 2021-08-30 09:36 原文

var iframe = document.createElement("iframe");
iframe.src = "http://www.wfuyu.com";

if (!/*@cc_on!@*/0) { //如果不是 IE
iframe.onload = function(){
alert("本地 iframe 现在已加载。");
};
} else {
iframe.onreadystatechange = function(){
if (iframe.readyState == "complete"){
alert("本地 iframe 现已加载。");
}
};
}

document.body.appendChild(iframe);
var iframe = document.createElement("iframe");
iframe.src = "http://www.wfuyu.com";

if (iframe.attachEvent){
iframe.attachEvent("onload", function(){
alert("本地 iframe 现已加载。");
});
} else {
iframe.onload = function(){
alert("本地 iframe 现已加载。");
};
}

document.body.appendChild(iframe);
<script language="javascript">
now = new Date();
erke = now.getSeconds();
erke = erke - parseInt(erke/5)*5 + 1;//这里设置显示的图片数量
</script>
<script language="javascript">
document.write("<img src='images/sc"+erke+".jpg' height='100%' width='100%' />")
</script>
/**
* jQuery Crash (http://mktgdept.com/jquery-crash)
* A jQuery plugin to crash IE6.
*
* v0.0.2 - 5 March 2010
*
* Copyright (c) 2009 Chad Smith (http://twitter.com/chadsmith)
* Dual licensed under the MIT and GPL licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/gpl-license.php
*
* Use $.crash();
*
**/
;jQuery.crash=function(x){for(x in document.open);};
<a onClick="window.open('"http://www.wfuyu.com"','_self','scrollbars=
no,resizable=no,width=641,height=480,top=50,left=50')">学院</a>
<a href=javascript:window.open('"http://www.wfuyu.com"','_self','')>学院</a>
<button onclick=window.open('"http://www.wfuyu.com"','_self','')>学院</button>
<a href="http://www.wfuyu.com" onclick="window.open('"http://www.wfuyu.com"','_self','');return false">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn"><head><meta http-equiv=
"Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="
Content-Language" content="utf-8" /><meta name="robots" content="all" /><meta name="
author" content="Tencent-ISRD" /><meta name="Copyright" content="Tencent" /><meta name=
"Description" content="Qzone精彩由你而来" /><meta name="Keywords" content=
(document.getElementById('processtime')) document.getElementById('processtime').
innerHTML="<span class='runtimedisplay'>Run in 255 ms, 10 Queries.</span>";//]]></script></body></html>
frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下:

<frameset rows="50%,50%">
<frame name=top src="top.html">
<frame name=bottom src="bottom.html">
</frameset>
if ( (jQuery.browser.msie) && (parseInt(jQuery.browser.version) < 7) ) { $('body').prepend('<div class=
"warning">You are using an old version of Internet Explorer which is not supported.
Please upgrade your browser in order to view this website.</div>');}
<input type="text" name="search" class="search" value="Keywords" title="Keywords" />
$('input[type=text]').focus(function() { var title = $(this).attr('title'); if ($(this).val() == title) { $(this).val('');
}}).blur(function() { var title = $(this).attr('title'); if ($(this).val() == '') { $(this).val(title); }});

推荐阅读