摘要: <script language="javascript"><!--// 声明字符串"javascript学习笔记,String字符串相关!"var txt = "javascript学习笔记,String字符串相关!"document.write( "<br>" );// 取得字符串长度document.write(txt.length);document.write( "<br>" );//查找"记"字所在位置function I 阅读全文
posted @ 2012-03-02 17:05 彭蓉 阅读(151) 评论(0) 推荐(0)
摘要: 编辑器加<script language="javascript"><!--//用for计算1+2+3+....+20 var num = 0; var total = 0; for(num = 0; num < 21; num++) { total = total+num; } document.write("--------- 总------: "+total);//用while计算1+2+3+....+20 var num = 0; var total = 0; while( num < 21) { total=nu. 阅读全文
posted @ 2012-03-02 15:46 彭蓉 阅读(571) 评论(0) 推荐(0)
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&g 阅读全文
posted @ 2012-03-02 14:24 彭蓉 阅读(290) 评论(0) 推荐(0)