javascript¶¯Ì¬´´½¨¿Ø¼þµÄ3ÖÖ·½·¨
ÒÔ´´½¨°´Å¥ÎªÀý
<html>
<head>
<script>
function add1()
{
var obtn=document.createElement("input");
obtn.setAttribute("type","button");
obtn.setAttribute("value","test1");
document.body.appendChild(obtn);//×¢ÒâÈç¹ûÓÐform±íµ¥²»ÒªÍü¼Ç¼ÓÈë±íµ¥
}
function add2()
{
var obtn=document.createElement("input");
obtn.type="button";
obtn.value="test2";
document.body.appendChild(obtn);
}
function add3()
{
var obtn="<input type='button' value='test3'/>";
document.body.innerHTML=obtn;//Õâ¸ö·½·¨»áɾ³ýbodyÖÐµÄÆäËü¿Ø¼þ ¿ÉÒÔÔ¤Ïȼӵ½¹Ì¶¨µÄÈÝÆ÷ÖÐ
}
</script>
</head>
<body>
<input type="button" value="add1" onclick="add1()"/>
<input type="button" value="add2" onclick="add2()"/>
<input type="button" value="add3" onclick="add3()"/>
</body>
</html>
Ïà¹ØÎĵµ£º
£¨Ò»£©aspxÒ³ÃæÉϵĴúÂëÆ¬¶Î
<body>
<script language="javascript" type="text/javascript">
function DisplayBehindCode() {
var text="<%=Name()%>";
alert(text);
}
</script>
....
<asp:Button ID ......
1£¬ jsÖеÄÀàÊý×é¶ÔÏó
(1) arguments¶ÔÏó:
function(){
//arguments¶ÔÏóÊÇArguments¶ÔÏóʵÀý£¬ÊÇÒ»¸öÀàÊý×é¶ÔÏ󣬲¢ÓµÓÐÏÂÁз½·¨
alert(arguments instanceof Array);//false
arguments.callee(); //¶Ô×ÔÉíµÄµ÷Ó㬠ÓÃÓڵݹé
var c = arguments.caller; //¶Ôµ÷ÓÃ×ÔÉíº¯ÊýµÄ¸¸º¯Êý, Èç¹û ......
1.js²»Ö§³ÖÖØÔØ£¬ÒòΪjsÀïµÄº¯Êý¶¼ÊÇÒ»¸ö¶ÔÏó£¬jsÀïÓиöÒþº¬¶ÔÏóFunction,ËùÓеÄjsº¯Êý¶¼ÊÇÒ»¸öFunctionÀàÐ͵ĶÔÏó¡£±ÈÈ磺
Java´úÂë
function add(number)
{
alert("hello");
}
function add(number)
{
alert("hello");
}
µÈ¼ÛÓ ......
<!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">
<head>
<title> new document </title>
<meta name="generator" content="edit ......