当然可以,如下列程序可在进入时弹出"hello"
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
window.onload=function()
{
alert("hello")
}
</script>
</HEAD><BODY></BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
window.onload=function()
{
alert("hello")
}
</script>
</HEAD><BODY></BODY>
</HTML>
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}實現Vbscript的trim功能﹗
{
return this.replace(/(^\s*)¦(\s*$)/g, "");
}
prototype指的是MTSPlugin的基本属性,LoadMTX是要加入的MTSPlugin的基本属性中的一项
而
function(path)
{
return this.Execute ("LoadMTX", path);
}
指的是作者自己定义的MTSPlugin.LoadMTX属性的功能。
你也可以自己定义这种面向对象的函数(其实是属性......将来的趋势)
{
return this.replace(/(^\s*)¦(\s*$)/g, "");
}
定義一個函數﹐名字是trim﹐功能是{}里面的操作。這是我的理解!