在做js字符串比較時(shí),
本以為js中能有和java中(equalsIgnoreCase())一樣很方便的忽略大小寫比較時(shí),結(jié)果沒有
最后必須把兩個(gè)字符串都變?yōu)樾?或大寫比較就可以了
if(inputCode.toLowerCase() != code.toLowerCase() ) /* 同時(shí)轉(zhuǎn)化為小寫,就可以忽略大小寫 */
link:
http://www.ijavascript.cn/jiaocheng/javascript-indexof-244.html
posted on 2009-03-20 18:02
fl1429 閱讀(16779)
評(píng)論(3) 編輯 收藏 所屬分類:
Ajax