<html>
<head>
<title></title>
</head>
<body>
<input type="button" onclick="window.setTimeout('var aa="ww";alert(aa)', 1, 'javascript')"
value="dd"></input>
</body>
</html>
上面定义aa是有错误的,请问该如何写才是正确的。
谢谢各位大哥帮忙!
<head>
<title></title>
</head>
<body>
<input type="button" onclick="window.setTimeout('var aa="ww";alert(aa)', 1, 'javascript')"
value="dd"></input>
</body>
</html>
上面定义aa是有错误的,请问该如何写才是正确的。
谢谢各位大哥帮忙!
<head>
<title></title>
</head>
<body>
<input type="button" onclick="var aa='ww'; window.setTimeout(alert(aa), 1, 'javascript')" value="dd">
<p>
</body>
</html>
应该写在function 中
那就不需要理会转义字符了
function cTmpCodeOnload( type)
{
alert(type)
setTimeout("cTmpCodeOnload("+type+")",5000)
}