写了个小程序
function isok(){
return confirm("是否确认提交数据?点【确定】提交,点【取消】放弃");
}function mainClick(){
//var isok = isok();报错:object expected
var ok = isok();
if(ok == true){
var yourname = document.getElementById("yourname").value;
var yourage = document.getElementById("yourage").value;
var yourmoney = document.getElementById("yourmoney").value;
var yourreslut = getResult();
outPrint(yourname, yourage, yourmoney, yourreslut);
}
}正如注释行的代码,页面会报错误object expected,没搞明白,请指教,谢谢。
function isok(){
return confirm("是否确认提交数据?点【确定】提交,点【取消】放弃");
}function mainClick(){
//var isok = isok();报错:object expected
var ok = isok();
if(ok == true){
var yourname = document.getElementById("yourname").value;
var yourage = document.getElementById("yourage").value;
var yourmoney = document.getElementById("yourmoney").value;
var yourreslut = getResult();
outPrint(yourname, yourage, yourmoney, yourreslut);
}
}正如注释行的代码,页面会报错误object expected,没搞明白,请指教,谢谢。
function isok(){
return confirm("是否确认提交数据?点【确定】提交,点【取消】放弃");
} function mainClick(){
isok.ok = isok();//报错:object expected
var ok = isok();
if(ok == true){
var yourname = document.getElementById("yourname").value;
var yourage = document.getElementById("yourage").value;
var yourmoney = document.getElementById("yourmoney").value;
var yourreslut = getResult();
outPrint(yourname, yourage, yourmoney, yourreslut);
}
}
function isok(){
return confirm("是否确认提交数据?点【确定】提交,点【取消】放弃");
} function mainClick(){
if(isok()){
var yourname = document.getElementById("yourname").value;
var yourage = document.getElementById("yourage").value;
var yourmoney = document.getElementById("yourmoney").value;
var yourreslut = getResult();
outPrint(yourname, yourage, yourmoney, yourreslut);
}
} mainClick();