我有函數比較用戶輸入與xml文件中的字符串,但如果有空間或拼寫錯誤它的返回false我希望它返回true,如果差異是一個字符比較字符串,並返回true如果有小拼寫錯誤
//xml file like this
<xmlString>HELLO</xmlString>
<result>somthing</result>
和腳本文件中像這樣
var userInput="Jello";
if (userInput.toUpperCase().indexOf(xmlString) >= 0){ //this should return true and execute
return $(result).text();
}
我該怎麼辦呢?有沒有功能,我可以使用它從jQuery或任何其他框架?
有一個美好的一天:)
什麼是小錯誤?六分之一? –
@NinaScholz是的,你可以這麼說 –