Home >Web Front-end >HTML Tutorial >为什么会出现警告??_html/css_WEB-ITnose
这样不报错了。
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);}
楼主先把格式整理一下吧,这样方便别人阅读,也方便自己找错