javascript¿ØÖÆÒ³Ãæ±íµ¥Öظ´Ìá½»
// PageLoadʼþ
var onloadMethod = window.onload;
window.onload = window_Load;
function window_Load() {
var i;
var item;
// È«²¿Á¬½ÓµÄʼþ
for (i = 0; i < document.links.length; i ++) {
item = document.links[i]
Object.Aspect.around(item, "onclick", checkLoading);
}
// È«²¿°´Å¥µÄʼþ
for (i = 0; i < document.forms[0].elements.length; i ++) {
item = document.forms[0].elements[i]
if (item.type == "button" ||
item.type == "submit" ||
item.type == "reset") {
Object.Aspect.around(item, "onclick", checkLoading);
}
}
if (onloadMethod != null && typeof (onloadMethod) == "function") {
// Ö´ÐÐPageµÄonloadʼþ
return onloadMethod();
} else {
return true;
}
}
// ·ÀÖ¹ÖØ¸´Ìá½»
var checkLoading = function(invocation) {
if (isDocumentLoading()) {
//alert("now loading…");
return false;
}
return invocation.proceed();
}
// µ±Ç°Ò³ÃæÌύ״̬ÅжÏ
function isDocumentLoading() {
return (document.readyState != null &&
document.readyState != "complete" &&
document.readyState != "interactive");
}
// Aspect ÓÃ
Object.Aspect = {
_around: function(target, methodName, aspect) {
var method = target[methodName];
target[methodName] = function() {
var invocation = {
"target" : this,
"method" : method,
"methodName" : methodName,
"arguments" : arguments,
"proceed" : function() {
if (!method) {
return true;
}
return method.apply(target, this.arguments);
}
};
return aspect.apply(null, [invocation]);
};
},
around: function(target, methodName, aspect) {
this._around(target, methodName, aspect);
}
}
Ïà¹ØÎĵµ£º
1¡¢¶ÔÏóµÄ·Ö¼¶Ìåϵ
¡¡¡¡Ã¿¸öHTMLÎĵµ±»×°Èëä¯ÀÀÆ÷ÖÐʱä¯ÀÀÆ÷¾Í´´½¨ÁËһϵÁзּ¶µÄ¶ÔÏóÌåϵ£¬´ËÌåϵ·´Ó³ÁËHTMLÎĵµµÄÊôÐÔ.
¡¡¡¡ÔÚÿһ¸öHTMLÒ³Öк¬ÓÐÏÂÃæµÄ¶ÔÏó£º
¡¡¡¡navigator£ºº¬ÓÐÕýÔÚʹÓõÄNavigatorµÄÃû³Æ¡¢°æ±¾ÊôÐÔ£¬¿Í»§¶ËÖ§³ÖµÄMIMEÀàÐÍÊôÐÔ£¬¿Í»§¶Ë°²×°µÄ"²å¼þ"ÀàÐÍ¡£
¡¡¡¡window£º×î¸ßµÈ¼¶µÄ¶ÔÏó£¬ÓµÓÐÕû¸ö´° ......
html:
<html>
<head>
<title>calendaragain</title>
<link rel=stylesheet href="calendaragain.css">
<script type = " ......
<html>
<head>
<mce:script type="text/javascript"><!--
function aaa()
{
alert("oh no");
window.location="http://community.csdn.net/";
}
// --></mce:script>
</head>
<body onload = aaa();>
< ......
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄÜ
²Ù×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [,
vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´ ......
selected¿Ø¼þ£ºÔÚjsÖеÄÉèÖÃÊÇĬÈÏÊÇ selected=true
buttonºÍcheckboxµÄ¿ÉÓÃÐÔÉèÖ㺠disabled=true
textÎļþµÄÖ»¶ÁÊôÐÔ£ºreadOnly
ÔÚ´æÔÚIframeµÄʱºòÔÚÐèÒª¿ØÖÆÍⲿÊý¾ÝµÄʱºòÐèÒªÓõ½ parent
¶ÔÏóûÓÐlengthÊôÐÔ£¬Ö»ÓÐÊý×éÓÐlength³¤¶È
ÔÚjsÖпÉÒÔ¶Ô¶ÔÏóËæÒ⸳ÊôÐÔ£¬Èç¹û¸ÃÊôÐÔûÓÐÖµÔòΪundefined
sortArra ......