/*---------------------------------------------------------------------------*\
| Subject: JavaScript Framework
| Author: meizz
| Created: 2005-02-27
| Version: 2006-08-11
|-----------------------------------
| MSN:huangfr@msn.com QQ:112889082
| http://www.meizz.com Copyright (c) meizz MIT-style license
| The above copyright notice and this permission notice shall be
| included in all copies or substantial portions of the Software
\*---------------------------------------------------------------------------*/
window.System = function(){this.setHashCode();}
System.debug=true; //false
System._codebase={};
try
{
if (window!=parent && parent.System && parent.System._codebase)
System._codebase = parent.System._codebase;
else if ("undefined"!=typeof opener&&opener.System&&opener.System._codebase)
System._codebase = opener.System._codebase;
else if ("undefined"!=typeof dialogArguments && dialogArguments.System)
System._codebase = dialogArguments.System._codebase;
}
catch(ex){}
System.MISSING_ARGUMENT="Missing argument";
System.ARGUMENT_PARSE_ERROR="The argument cannot be parsed";
System.NOT_SUPPORTED_XMLHTTP="Your browser do not support XMLHttp";
System.FILE_NOT_FOUND="File not found";
System.MISCODING="Maybe file encoding is not ANSI or UTF-8";
System.NAMESPACE_ERROR=" nonstandard namespace";
System.hashCounter=0;
System.currentVersion="20060811";
var t=document.getElementsByTagName("SCRIPT");
t=(System.scriptElement=t[t.length-1]).src.replace(/\\/g, "/");
System.incorporate=function(d,s){for(var i in s)d[i]=s[i];return d;};
System.path=(t.lastIndexOf("/")System.getUniqueId=function(){return "mz_"+(System.hashCounter++).toString(36);};
System.toHashCode=function(e)
{
if("undefined"!=typeof e.hashCode) return e.hashCode;
return e.hashCode=System.getUniqueId();
};
System.supportsXmlHttp=function()
{
return "object"==typeof(System._xmlHttp||(System._xmlHttp=new XMLHttpRequest()));
};
System._getPrototype=function(namespace, argu)
{
if("undefined"==typeof System._prototypes[namespace])return new System();
for(var a=[], i=0; i
};
System.ie=navigator.userAgent.indexOf("MSIE")>0 && !window.opera;
System.ns=navigator.vendor=="Netscape";
System._alert=function(msg){if(System.debug)alert(msg);};
System._parseResponseText=function(s)
{
if (null==s||"\uFFFD"==s.charAt(0)){System._alert(System.MISCODING);return "";}
if ("\xef"==s.charAt(0))s=s.substr(3); //for firefox
return s.replace(/(^|\n)\s*\/\/+\s*((Using|Import|Include)\((\"|\'))/g,"$1$2");
};
if(window.ActiveXObject && (System.ie || !window.XMLHttpRequest))
{
window.XMLHttpRequest = function()
{
var msxmls=['MSXML3','MSXML2','Microsoft'], ex;
for(var i=0;i
System._xmlHttp="mz"; throw new Error(System.NOT_SUPPORTED_XMLHTTP);
}
}
System.load = function(namespace, path)
{
try
{
if(System.supportsXmlHttp()){path=System._mapPath(namespace, path);
var x=System._xmlHttp; x.open("GET",path,false); x.send(null);
if (x.readyState==4)
{
if(x.status==0||/^file\:/i.test(path))
return System._parseResponseText(x.responseText);
else if(x.status==200)return System._parseResponseText(x.responseText);
else if(x.status==404)System._alert(namespace+"\n"+System.FILE_NOT_FOUND);
else throw new Error(x.status +": "+ x.statusText);}
} else System._alert(System.NOT_SUPPORTED_XMLHTTP);
}
catch(ex){System._alert(namespace+"\n"+ex.message);}return "";
};
System._eval = function(namespace, path)
{
//alert("System._eval(\""+namespace+"\")=\r\n"+System._codebase[namespace]);
try{if(window.execScript)window.execScript(System._codebase[namespace]);else
{
var script=document.createElement("SCRIPT");script.type="text/javascript";
script.innerHTML="eval(System._codebase['"+ namespace +"']);";
document.getElementsByTagName("HEAD")[0].appendChild(script);
setTimeout(function(){script.parentNode.removeChild(script)},99);
}}catch(ex){System._alert("Syntax error on load "+ namespace);}
System._existences[namespace]=System._mapPath(namespace, path);
};
System._exist = function(namespace, path)
{
if("undefined"==typeof System._existences[namespace]) return false;
return System._existences[namespace]==System._mapPath(namespace,path);
};
System._mapPath = function(namespace, path)
{
if("string"==typeof path && path.length>3)return path.toLowerCase();
var p=(System.path+"/"+namespace.replace(/\./g,"/")+".js").toLowerCase();
return p +(("undefined"==typeof path||path) ? "" : "?t="+ Math.random());
};
window.Using = function(namespace, path, rename)
{
if(System._exist(namespace, path)){
var s=window[namespace.substr(namespace.lastIndexOf(".")+1)];
if(s!=System._prototypes[namespace])s=System._prototypes[namespace];return}
var code=namespace +"."; if(!/((^|\.)[\w\$]+)+$/.test(namespace))
throw new Error(namespace+System.NAMESPACE_ERROR);
for(var i=code.indexOf("."); i>-1; i=code.indexOf(".", i+1)){
var e= code.substring(0,i), s=(e.indexOf(".")==-1) ? "window[\""+e+"\"]":e;
if(e&&"undefined"==typeof(s)){
eval(s+"=function(){return System._getPrototype(\""+e+"\", arguments)}");}}
if("undefined"==typeof path &&"string"==typeof System._codebase[namespace])
{
System._eval(namespace, path);}else{if(code=System.load(namespace,path)){
e = "$"+ System.getUniqueId() +"__id"+ new Date().getTime() +"$";
s = "function "+e+"(){\r\n"+code+";\r\nSystem._prototypes['";
code=namespace.substr(namespace.lastIndexOf(".")+1);
s += namespace+"']=window['"+(rename||code)+"']="+code+";\r\n}"+e+"();";
System._codebase[namespace]=s;s="";System._eval(namespace, path);}
}
};
window.Import=function(namespace,path,rename){Using(namespace,path,rename)};
window.Instance=function(hashCode){return System._instances[hashCode]};
window.Include=function(namespace, path)
{
if(System._exist(namespace, path)) return;
var code;if(!/((^|\.)[\w\$]+)+$/.test(namespace))
throw new Error(namespace + System.NAMESPACE_ERROR);
if("undefined"==typeof path&&"string"==typeof(System._codebase[namespace]))
{
System._eval(namespace, path);}else if(System.supportsXmlHttp()){
if(code=System.load(namespace, path)){System._codebase[namespace]=code;
System._eval(namespace, path);}}else{
var script=document.createElement("SCRIPT");script.type="text/javascript";
script.src=System._existences[namespace]=System._mapPath(namespace,path);
document.getElementsByTagName("HEAD")[0].appendChild(script);
setTimeout(function(){script.parentNode.removeChild(script)},99);
}
};
Function.READ=1;Function.WRITE=2;Function.READ_WRITE=3;
Function.prototype.addProperty=function(name,initValue,r_w)
{
var capital=name.charAt(0).toUpperCase()+name.substr(1);
r_w=r_w||Function.READ_WRITE; name="_"+name; var p=this.prototype;
if("undefined"!=typeof initValue) p[name]=initValue;
if(r_w&Function.READ) p["get"+ capital]=function(){return this[name];};
if(r_w&Function.WRITE) p["set"+ capital]=function(v){this[name]=v;};
};
Function.prototype.Extends=function(SuperClass,ClassName)
{
var op=this.prototype, i, p=this.prototype=new SuperClass();
if(ClassName)p._className=ClassName; for(i in op)p[i]=op[i];
if(p.hashCode)delete System._instances[p.hashCode];return p;
};
System._instances={};
System._prototypes=
{
"System":System,
"System.Object":System,
"System.Event":System.Event
};
System._existences=
{
"System":System._mapPath("System"),
"System.Event":System._mapPath("System.Event"),
"System.Object":System._mapPath("System.Object")
};
t=System.Extends(Object, "System"); System.Object = System;
t.decontrol=function(){var t;if(t=this.hashCode)delete System._instances[t]};
t.addEventListeners=function(type, handle)
{
if("function"!=typeof handle)
throw new Error(this+" addEventListener: "+handle+" is not a function");
if(!this._listeners) this._listeners={};
var id=System.toHashCode(handle), t=this._listeners;
if("object"!=typeof t[type]) t[type]={}; t[type][id]=handle;
};
t.removeEventListener=function(type, handle)
{
if(!this._listeners)this._listeners={}; var t=this._listeners;
if(!t[type]) return; var id=System.toHashCode(handle);
if( t[type][id])delete t[type][id];if(t[type])delete t[type];
};
t.dispatchEvent=function(evt)
{
if(!this._listeners)this._listeners={};
var i, t =this._listeners, p =evt.type;
evt.target=evt.srcElement=this; if(this[p])this[p](evt);
if("object"==typeof t[p]) for(i in t[p]) t[p][i].call(this,evt);
delete evt.target; delete evt.srcElement;return evt.returnValue;
};
t.setHashCode=function()
{
System._instances[(this.hashCode=System.getUniqueId())]=this;
};
t.getHashCode=function()
{
if(!this.hashCode)this.setHashCode(); return this.hashCode;
};
t.toString=function(){return "[object "+(this._className||"Object")+"]";};
System.Event=function(type){this.type=type;};
t=System.Event.Extends(System, "System.Event");
t.returnValue=true;
t.cancelBubble=false;
t.target=t.srcElement=null;
t.stopPropagation=function(){this.cancelBubble=true;};
t.preventDefault =function(){this.returnValue=false;};
if(System.ie && !System.debug) Include("System.Plugins.IE"); //IE UserData
if(window.opera) Include("System.Plugins.Opera"); //Opera support
Include("System.Global");mztreeview2.rar

JavaScript是现代网站的核心,因为它增强了网页的交互性和动态性。1)它允许在不刷新页面的情况下改变内容,2)通过DOMAPI操作网页,3)支持复杂的交互效果如动画和拖放,4)优化性能和最佳实践提高用户体验。

C 和JavaScript通过WebAssembly实现互操作性。1)C 代码编译成WebAssembly模块,引入到JavaScript环境中,增强计算能力。2)在游戏开发中,C 处理物理引擎和图形渲染,JavaScript负责游戏逻辑和用户界面。

JavaScript在网站、移动应用、桌面应用和服务器端编程中均有广泛应用。1)在网站开发中,JavaScript与HTML、CSS一起操作DOM,实现动态效果,并支持如jQuery、React等框架。2)通过ReactNative和Ionic,JavaScript用于开发跨平台移动应用。3)Electron框架使JavaScript能构建桌面应用。4)Node.js让JavaScript在服务器端运行,支持高并发请求。

Python更适合数据科学和自动化,JavaScript更适合前端和全栈开发。1.Python在数据科学和机器学习中表现出色,使用NumPy、Pandas等库进行数据处理和建模。2.Python在自动化和脚本编写方面简洁高效。3.JavaScript在前端开发中不可或缺,用于构建动态网页和单页面应用。4.JavaScript通过Node.js在后端开发中发挥作用,支持全栈开发。

C和C 在JavaScript引擎中扮演了至关重要的角色,主要用于实现解释器和JIT编译器。 1)C 用于解析JavaScript源码并生成抽象语法树。 2)C 负责生成和执行字节码。 3)C 实现JIT编译器,在运行时优化和编译热点代码,显着提高JavaScript的执行效率。

JavaScript在现实世界中的应用包括前端和后端开发。1)通过构建TODO列表应用展示前端应用,涉及DOM操作和事件处理。2)通过Node.js和Express构建RESTfulAPI展示后端应用。

JavaScript在Web开发中的主要用途包括客户端交互、表单验证和异步通信。1)通过DOM操作实现动态内容更新和用户交互;2)在用户提交数据前进行客户端验证,提高用户体验;3)通过AJAX技术实现与服务器的无刷新通信。

理解JavaScript引擎内部工作原理对开发者重要,因为它能帮助编写更高效的代码并理解性能瓶颈和优化策略。1)引擎的工作流程包括解析、编译和执行三个阶段;2)执行过程中,引擎会进行动态优化,如内联缓存和隐藏类;3)最佳实践包括避免全局变量、优化循环、使用const和let,以及避免过度使用闭包。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)