您好,欢迎访问一九零五行业门户网

为什么会出现警告??_html/css_WEB-ITnose

本帖最后由 yczhaoliao 于 2012-09-25 19:36:52 编辑
var xmlhttp;
function $(id){
return document.getelementbyid(id);
}
function createxmlhttprequest(){
try {
xmlhttp = new activexobject(msxml2.xmlhttp);
} catch (e) {
try {
xmlhttp = new activexobject(microsoft.xmlhttp);
} catch (e1) {
try {
xmlhttp = new xmlhttprequest();
if(xmlhttp.overridemimetype){
xmlhttp.overridemimetype(text/xml);
}
} catch (e2) {
}
}
}
}
function update(bid,price){
createxmlhttprequest();
var count = $(count).value;
var url = modify?bid=+bid+&count=+count+&price=+price;
xmlhttp.open(post, url, true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readystate == 4){
if(xmlhttp.status == 200){
var str = xmlhttp.responsetext;
var price = $(price).value;
var t_price = count*price;
total.innerhtml = +t_price+;
}
}
} 这个地方会出现警告(就旁边这个中括号)。不知道为什么?
xmlhttp.send(null);
}
回复讨论(解决方案) 这样不报错了。
var xmlhttp;function $(id){ return document.getelementbyid(id);}function createxmlhttprequest(){ try { xmlhttp = new activexobject(msxml2.xmlhttp); } catch (e) { try { xmlhttp = new activexobject(microsoft.xmlhttp); } catch (e1) { try { xmlhttp = new xmlhttprequest(); if(xmlhttp.overridemimetype){ xmlhttp.overridemimetype(text/xml); } } catch (e2) { } } }}function update(bid,price){ createxmlhttprequest(); var count = $(count).value; var url = modify?bid=+bid+&count=+count+&price=+price; xmlhttp.open(post, url, true); xmlhttp.onreadystatechange = function(){ if(xmlhttp.readystate == 4){ if(xmlhttp.status == 200){ var str = xmlhttp.responsetext; var price = $(price).value; var t_price = count*price; total.innerhtml = +t_price+; } } } xmlhttp.send(null);}
楼主先把格式整理一下吧,这样方便别人阅读,也方便自己找错
其它类似信息

推荐信息