ajax.js 文件 window.onload=function(){
function dd(){
alert("dd")//就这个dd函数根本执不了,,提示缺少对象
}
html
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" src="ajax.js"></script>
<style type="text/css"> #vote_good { width:80px; height:50px; background:#009933;}
#vote_bad{ width:80px; height:50px; background:#009933;}</style>
<script language="javascript">
</script>
</head><body> <div id="vote_good" onclick="get_data('vote_good')"> </div>
<br />
<br />
<div id="vote_bad" onclick="dd()"> </div> //这个DD函数当单时执行不了。,,,,,提示缺少对象
</body>
</html>
function dd(){
alert("dd")//就这个dd函数根本执不了,,提示缺少对象
}
html
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" src="ajax.js"></script>
<style type="text/css"> #vote_good { width:80px; height:50px; background:#009933;}
#vote_bad{ width:80px; height:50px; background:#009933;}</style>
<script language="javascript">
</script>
</head><body> <div id="vote_good" onclick="get_data('vote_good')"> </div>
<br />
<br />
<div id="vote_bad" onclick="dd()"> </div> //这个DD函数当单时执行不了。,,,,,提示缺少对象
</body>
</html>
window.onload=function(){
function dd(){
alert("dd")//就这个dd函数根本执不了,,提示缺少对象
}把function dd() {
}放到onload 外面去function dd() {};
window.onload = function(){
}