摘要:
<script type="text/javascript"> /* indexOf() 用于查找字符串有是否有这个字符,返回索引 var the_email = prompt("what\'s your email address?",""); var temp = the_email.indexOf('@'); if(temp==-1){ alert("your email have not @ char."); }*//* charAt() 可以返回字串中的某个字符 var 阅读全文
摘要:
好久没有写东西了。对象字面量:var car = {myCar:"Saturn",getCar:CarTypes("Honda"),special:Sales};alert(car.myCar) //output Saturnvar car = { manyCars: {a: "Saab", "b": "Jeep"}, 7: "Mazda" };document.write(car.manyCars.b); // Jeepdocument.write(car[7]); // 阅读全文