function JS_cruel_search(data,key) ? ? ? /*JS暴虐查找*/
{
var re = new RegExp(key,[""])
return (data.toString().replace(re,"┢").replace(/[^,┢]/g,"")).indexOf("┢")
}
?
function show()
{
p=document.getElementById('DataWord').value.split(",")
key=keyWord.value
result=JS_cruel_search(p,key)
if(result>-1)
{
alert("“"+key+"”就在第"+(result+1)+"个位置上。")
}
else
{
alert("没找到!")
}
}