日期:2014-05-16  浏览次数:20329 次

JavaScript 调用函数怎么老是提示 找不到对象啊??
//函数调用
btnSimpQury_onclick()
{
        QueryCmd(condition);
}  

function   QueryCmd(condition)
                {
                        document.getElementById( 'divShowResult ').innerText   =Scmd;  
                }

//html调用
<input   id= "Button1 "   type= "button "   value= "button "   onclick= "btnSimpQury_onclick() "   />

------解决方案--------------------
btnSimpQury_onclick = function()
{
QueryCmd(condition);
}
------解决方案--------------------
查condition参数的值,Scmd中的值
------解决方案--------------------
<script language= "javascript ">
function btnSimpQury_onclick(condition)
{
QueryCmd(condition);
}

function QueryCmd(condition)
{
document.getElementById( 'divShowResult ').innerText =condition;
}
</script>
<div id= "divShowResult "> </div>
<input id= "Button1 " type= "button " value= "button " onclick= "btnSimpQury_onclick( 'aaaaaaa ') " />
------解决方案--------------------
<script language= "javascript ">
function btnSimpQury_onclick()
{
var condition;
condition = 'LemsunOA ';
QueryCmd(condition);
}

function QueryCmd(condition)
{
document.getElementById( 'divShowResult ').innerText =condition;
}
</script>
<div id= "divShowResult "> </div>
<input id= "Button1 " type= "button " value= "button " onclick= "btnSimpQury_onclick() " />