Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 有错误的问题。如何摆脱(索引):479未捕获引用错误:grabText未定义?_Javascript_Html_Wordpress_Function - Fatal编程技术网

Javascript 有错误的问题。如何摆脱(索引):479未捕获引用错误:grabText未定义?

Javascript 有错误的问题。如何摆脱(索引):479未捕获引用错误:grabText未定义?,javascript,html,wordpress,function,Javascript,Html,Wordpress,Function,添加一些空检查之类的东西,因为我在混乱时出错,它需要一个值 我在这一行之后删除了一个坏字符,并将函数从docready中取出 (index):479 Uncaught ReferenceError: grabText is not defined at HTMLTextAreaElement.onkeyup ((index):479) 函数grabText(){ var x=document.getElementById(“enteredText”).value; document.

添加一些空检查之类的东西,因为我在混乱时出错,它需要一个值

我在这一行之后删除了一个坏字符,并将函数从docready中取出

(index):479 Uncaught ReferenceError: grabText is not defined
    at HTMLTextAreaElement.onkeyup ((index):479)
函数grabText(){
var x=document.getElementById(“enteredText”).value;
document.getElementById(“text”).innerHTML=x;
getTotal();
}
var changeFontStyle=函数(字体){
document.getElementById(
“文本”).style.fontFamily
=font.value;
};
var changeColorStyle=函数(颜色){
document.getElementById(“text”).style.color=color.value;
};
函数countChars(obj){
var maxLength=20;
变量strLength=obj.value.length+1;
var CHARLISE=(最大长度-strLength);
document.getElementById(“hiddenChars”).value=strLength;
如果(字符数小于0){
document.getElementById(“remainingChars”).innerHTML='您已超过'+maxLength+'字符数'的限制;
}否则{
document.getElementById(“remainingChars”).innerHTML=charleism+“剩余字符”;
}
};
函数getTotal(){
var z=document.getElementById(“hiddenChars”).value;
var x=document.getElementById(“selectedSize”).value;
变量y=document.getElementById(“selectedMount”).value;
var d=document.getElementById(“selectedDimmer”).value;
如果(x!=“选择”&&z==”){
document.getElementById(“outputCost”).innerHTML='请输入自定义文本';
document.getElementById(“price”).value=NULL;
document.getElementById(“submitValue”).disabled=true;
}
如果(x==“20”&&z==“1”){
document.getElementById(“outputCost”).innerHTML='$180';
document.getElementById(“price”).value=parseFloat(“180.00”);
}
如果(x==“30”&&z==“1”){
document.getElementById(“outputCost”).innerHTML='$263';
document.getElementById(“price”).value=parseFloat(“263.00”);
}
如果(x==“40”&&z==“1”){
document.getElementById(“outputCost”).innerHTML='$306';
document.getElementById(“price”).value=parseFloat(“306.00”);
}
如果(x==“50”&&z==“1”){
document.getElementById(“outputCost”).innerHTML='$330';
document.getElementById(“price”).value=parseFloat(“330.00”);
}
如果(x==“60”&&z==“1”){
document.getElementById(“outputCost”).innerHTML='$380';
document.getElementById(“price”).value=parseFloat(“380.00”);
}
如果(x==“20”&&z==“2”){
document.getElementById(“outputCost”).innerHTML='$200';
document.getElementById(“price”).value=parseFloat(“200.00”);
}
如果(x==“30”&&z==“2”){
document.getElementById(“outputCost”).innerHTML='$286';
document.getElementById(“price”).value=parseFloat(“286.00”);
}
如果(x==“40”&&z==“2”){
document.getElementById(“outputCost”).innerHTML='$332';
document.getElementById(“price”).value=parseFloat(“332.00”);
}
如果(x==“50”&&z==“2”){
document.getElementById(“outputCost”).innerHTML='$360';
document.getElementById(“price”).value=parseFloat(“360.00”);
}
如果(x==“60”&&z==“2”){
document.getElementById(“outputCost”).innerHTML='$410';
document.getElementById(“price”).value=parseFloat(“410.00”);
}
如果(x==“20”&&z==“3”){
document.getElementById(“outputCost”).innerHTML='$220';
document.getElementById(“price”).value=parseFloat(“220.00”);
}
如果(x==“30”&&z==“3”){
document.getElementById(“outputCost”).innerHTML='$309';
document.getElementById(“price”).value=parseFloat(“309.00”);
}
如果(x==“40”&&z==“3”){
document.getElementById(“outputCost”).innerHTML='$358';
document.getElementById(“price”).value=parseFloat(“358.00”);
}
如果(x==“50”&&z==“3”){
document.getElementById(“outputCost”).innerHTML='$480';
document.getElementById(“price”).value=parseFloat(“480.00”);
}
如果(x==“60”&&z==“3”){
document.getElementById(“outputCost”).innerHTML='$440';
document.getElementById(“price”).value=parseFloat(“440.00”);
}
如果(x==“20”&&z==“4”){
document.getElementById(“outputCost”).innerHTML='$240';
document.getElementById(“price”).value=parseFloat(“240.00”);
}
如果(x==“30”&&z==“4”){
document.getElementById(“outputCost”).innerHTML='$332';
document.getElementById(“price”).value=parseFloat(“332.00”);
}
如果(x==“40”&&z==“4”){
document.getElementById(“outputCost”).innerHTML='$384';
document.getElementById(“price”).value=parseFloat(“384.00”);
}
如果(x==“50”&&z==“4”){
document.getElementById(“outputCost”).innerHTML='$580';
document.getElementById(“price”).value=parseFloat(“580.00”);
}   
如果(x==“60”&&z==“4”){
document.getElementById(“outputCost”).innerHTML='$470';
document.getElementById(“price”).value=parseFloat(“470.00”);
}
如果(x==“20”&&z==“5”){
document.getElementById(“outputCost”).innerHTML='$260';
document.getElementById(“price”).value=parseFloat(“260.00”);
}
如果(x==“30”&&z==“5”){
document.getElementById(“outputCost”).innerHTML='$355';
document.getElementById(“price”).value=parseFloat(“355.00”);
}
如果(x==“40”&&z==“5”){
document.getElementById(“outputCost”).innerHTML='$410';
document.getElementById(“price”).value=parseFloat(“410.00”);
}
如果(x==“50”&&z==“5”){
document.getElementById(“outputCost”).innerHTML='$458';
document.getElementById(“price”).value=parseFloat(“458.00”);
}
如果(x==“60”&&z==“5”){
document.getElementById(“outputCost”).innerHTML='$500';
document.getElementById(“price”).value=parseFloat(“500.00”);
}
如果(x==“20”&&z==“6”){
document.getElementById(“outputCost”).innerHTML='$280';
document.getElementById(“price”).value=parseFloat(“280.00”);
}
如果(x==“30”&&z==“6”){
document.getElementById(“outputCost”).innerHTML='$378';
document.getElementById(“price”).value=parseFloat(“378.00”);
(index):479 Uncaught ReferenceError: grabText is not defined
    at HTMLTextAreaElement.onkeyup ((index):479)
document.getElementById("price").value = parseFloat("540.00"); '