网站根本没动,居然出现乱码,求解,谢谢
我网站根本没有任何变化,但是却出现这种乱码。
function(val) { for (var i = 0; i < this.length; i++) { if (this[i] == val) return i; } return -1; }
function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } else { this.pop(); } }
每当我点“添加”的时候就出现这种乱码,谁能告诉我怎么回事吗?怎么解决呢
------最佳解决方案--------------------这些代码是你文件本身原有的嘛?用FIREBUG看看页面,查看代码添加提交的时候对应的做了些什么操作
------其他解决方案--------------------你的jsfunction里的this是什么,如果在window环境中那就是整个document对象了,这是你原意吗
------其他解决方案--------------------还有你的js代码写到script标签内了吗
------其他解决方案--------------------');
var smokeprice = smokevalue[1];
yandaimoneys=yandaimoneys+Number(smokeprice*Number(yandai_cnt.value));
document.getElementById('yandaimoneys').value=yandaimoneys;
var ydid=Number(smokevalue[0])+Number(smokevalue1[0]);
if(arrYandaiValue[ydid]){
arrYandaiCnt[ydid] = Number(arrYandaiCnt[ydid])+Number(yandai_cnt.value);
}else{
arrYandaiValue[ydid] = true;
arrYandaiCnt[ydid] = yandai_cnt.value;
}
if(arrYandaiCnt[ydid]>0){
arrYandaiProduct[ydid] = '→'+yandaivalue+'*'+yandaiweivalue+'*'+arrYandaiCnt[ydid]+'盒小计:'+smokeprice*arrYandaiCnt[ydid]+'元 <input type="button" value="删除" onclick="delyandai('+ydid+','+smokeprice+')">';
arrYandaiContent[ydid] = '→'+yandaivalue+'*'+yandaiweivalue+'*'+arrYandaiCnt[ydid]+'盒小计:'+smokeprice*arrYandaiCnt[ydid]+'元';
}
for(yandaival in arrYandaiProduct){
if(arrYandaiProduct[yandaival]){
content += arrYandaiProduct[yandaival]+'<br>';
}
}
yandaiview.innerHTML = content;
yandai_cnt.value=1;
Yandais(arrYandaiContent);
}
function delyandai(id,obj){
yandaimoneys=yandaimoneys-Number(obj*arrYandaiCnt[id]);
document.getElementById('yandaimoneys').value=yandaimoneys;
var yandaival = 0;
var content = '';
var yandaiview = document.getElementById('yandaiview');
arrYandaiProduct[id] = '';
arrYandaiContent[id] ='';
for(yandaival in arrYandaiProduct){
if(arrYandaiProduct[yandaival]){
content += arrYandaiProduct[yandaival]+'<br>';
}
}
arrYandaiProduct[id] = '';
arrYandaiCnt[id] = 0;
yandaiview.innerHTML = content;
Yandais(arrYandaiContent);
}
function Yandais(arr){
var yandaival = 0;
var content = '';
var yandais = document.getElementById('yandais');
for(yandaival in arr){
if(arr[yandaival]){
content += arr[yandaival]+"\n";
}
}
yandais.value = content;
}
function SubmitBuy(){
var sv=document.getElementById("smokeview").innerHTML;//产品列表
var as=document.getElementById("smokeadd");//产品添加按钮
var yv=document.getElementById("yandaiview").innerHTML;//烟弹列表
var ay=document.getElementById("yandaiadd");//烟弹添加按钮
var ordName=document.getElementById("ordName");//订购人姓名
var addre=document.getElementById("addre");//详细地址