理解javascript中arguments,callee,caller
<!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" lang="gb2312">
<head>
<head>
<title> 关于arguments,callee,caller等的测试 </title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
</head>
<body>
<script type="text/javascript">
function testArg()
{
var sTemp ="test()开始执行\n\n函数定义的正文:\n\n";
sTemp+=arguments.callee + "\n\n";
sTemp+="传入参数的长度:\n";
sTemp+=arguments.length+"\n\n";
sTemp+="传入参数的内容:\n";
for (var i=0;i<arguments.length;i++){
sTemp+=arguments[i]+"\n";
}
sTemp+="\n点击确定,开始调用a();";
alert(sTemp);
a(arguments);
}
function a(args)
{
var sTemp ="a()开始执行\n\n函数定义的正文:\n\n";
sTemp+=arguments.callee + "\n\n";
sTemp+="传入参数的长度:\n";
sTemp+=arguments.length+"\n\n";
sTemp+="传入参数的内容:\n";
for (var i=0;i<arguments.length;i++){
sTemp+=arguments[i]+"\n";
}
sTemp+="\n当前函数的调用者:\n";
sTemp+=arguments.callee.caller+"\n\n";
sTemp+="\n点击确定,开始调用b();";
alert(sTemp);
b(args);
}
function b(args)
{
var sTemp ="b()开始执行\n\n函数定义的正文:\n\n";
sTemp+=argumen
相关文档:
<script language="javascript" type="text/javascript">
var fullDate23=new Date();
var dateString22=new Date(fullDate23.getYear(),(fullDate23.getMonth()),fullDate23.getDate());
var dateString23=new Date(dateString22.valueOf()+1*24*60*60*1000);"&vbcrlf&_
var showDateString1=dateStri ......
//创建一个新的用户对象,接受一个有许多属性的对象作为参数
function User(properties)
{
for(var i in properties){(function(which){
var p=i;
//创建此属性的一个新的读取器(getter)
which["get"+p] = function(){
&nbs ......
1.asp.net呼叫js
view
plain
copy
to clipboard
print
?
Response.Write("<mce:script language=javascript><!--
");
Response.Write("alert('欢迎您 ');"
);
Response.Write("location.href='login.aspx';"
)& ......
delete只能删除开发者定义的属性或方法,原始的ECMAScript方法不能删除,因为不是开发者定义的,比如:toString()。
var o = new Object;
o.name = "Nicholas";
delete o.name;
&n ......
按钮式:
<INPUT name="pclog" type="button" value="/GO" onClick="location.href='http://game.unimagic.cn'">
链接式:
<a href="javascript:history.go(-1)">返回上一步</a>
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
直接跳转式:
<scrip ......