str="dfkla;fj[}";
if(str.indexOf("[")!=-1)
alert("There is '[' in str.");
if(str.indexOf("{")!=-1)
alert("There is '{' in str.");
str.indexOf("{")返回的值是{在str中的位置。
if(str.indexOf("[")!=-1)
alert("There is '[' in str.");
if(str.indexOf("{")!=-1)
alert("There is '{' in str.");
str.indexOf("{")返回的值是{在str中的位置。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货