javascript - 在使用 JavaScript 的 HTML 的结果中获得了 `function () { [native code] }` 值
问题描述
我在 HTML 结果中得到function () { [native code] }值。
function getWarning(type)
从警告数组中按类型获取警告。
function getCaches()
从缓存数组中获取所有缓存的警告。
function cacheWarning(type)
如果不在缓存数组中,则添加缓存警告。
JavaScript:
var warnings=['- Le nom très petite !','- Cette prénom très petite ! !',"- Votre age invalide, le moin de l'age est 18 !","- Le numéro de téléphone incorrect !",'- Email invalide !',"- Le mot de pass doit de contient les caractéres et les nombres !",'- Le mot de pass sans confirmer !'];
var caches=new Array("");
var i=0;
function getWarning(type){
i=0;
for(i in warnings){
if(warnings[i].includes(type)){return warnings[i];}
}
}
function getCaches(){
let allCaches="";
i=0;
for(i in caches){
allCaches+=caches[i]+"<br/>";
}
return allCaches;
}
function cacheWarning(type){
i=0;
for(i in caches){
if(caches[i]==getWarning(type)){
return -1;
}
}
caches[caches.length]=getWarning(type);
}
if(document.getElementsByName("prenom")[0].value.length<=2){if(cacheWarning("prénom")!=-1){$("#content").html(getCaches())}}
解决方案
推荐阅读
- sas - 迭代值列表
- angular - 错误:找不到具有未指定名称属性的控件
- excel - 一周中第一天没有假期的Excel公式
- ruby - Nokogiri xpath - 使用属性条件计算 XML 元素的出现次数
- git - VS Code git pull 仅在 Visual Studio (2017) 运行时有效
- reactjs - 未处理的承诺拒绝:语法错误
- python - 我应该为所有正在运行的代码导入“drive.mount”吗?
- python-3.x - opencv问题足够的值来解包(预期3,得到2)
- google-cloud-platform - 谷歌视觉产品搜索的图像大小调整最佳实践
- python - 如何从 Dash Plotly 应用程序通过浏览器进行 API 调用