我有一個jquery autosuggest插件,其中當我鍵入ex。 Korea
然後它顯示2分的結果即 Korea (North)
& Korea (South)
但是當i型Korea (
,其不顯示任何結果,其中它必須證明既Korea (North)
& Korea (South)
。javascript搜索()工作問題
在錯誤的代碼搜索後,然後我發現了一個search()
功能,用於搜索結果中的字符串類型..
表示: Korea (
在Korea (North)
& Korea (South)
,我認爲這個搜索功能停在支架(
,我不知道爲什麼?
請,建議搜索()函數刪除這個錯誤..
代碼:::
str.search(query) != -1
其中:海峽=在時間,即Korea (North)
查詢=輸入的字符串一個結果,即Korea (
它不工作.. 當我輸出的結果作爲使用。 ` console.log(str.substr(0,query.length)+''+ query);`=`kore orea` where query is the enterd string ie`orea` now now not working working。 – 2011-02-02 08:11:08
then then use` str.indexOf(query)!= -1` :-) – arnaud576875 2011-02-02 09:00:44