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);
}
}
Ïà¹ØÎĵµ£º
///
<summary>
///
һЩ³£ÓõÄJavascript·½·¨
///
</summary>
public
static
class
Jscript
{
///
<summary>
///
µ¯³öÌáʾ¿ò
///
</summary>
public
static
void
Alert(Page page ......
javascript ¿ØÖÆ htmlÔªËØ ÏÔʾ/Òþ²Ø
1¡£±àдjsº¯Êý
<script type="text/javascript">
function display(y){$(y).style.display=($(y).style.display=="none")?"":"none";}
function $(s){return document.getElementById(s);}
</script>
2. ÒªÏÔÊ ......
html:
<html>
<head>
<title>calendaragain</title>
<link rel=stylesheet href="calendaragain.css">
<script type = " ......
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄÜ
²Ù×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [,
vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´ ......
1ÅжÏselectÑ¡ÏîÖÐ ÊÇ·ñ´æÔÚValue="paraValue"µÄItem
2ÏòselectÑ¡ÏîÖÐ ¼ÓÈëÒ»¸öItem
3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem
4ɾ³ýselectÖÐÑ¡ÖеÄÏî
5ÐÞ¸ÄselectÑ¡ÏîÖÐ value="paraValue"µÄtextΪ"paraText"
6ÉèÖÃselectÖÐtext="paraText"µÄµÚÒ»¸öItemΪѡÖÐ
7ÉèÖÃselectÖÐvalue="paraValue"µÄItemΪѡÖÐ
8µÃµ½selectµ ......