实验二简单JavaScript的程序实现

实验二简单JavaScript的程序实现

ID:41618655

大小:117.41 KB

页数:10页

时间:2019-08-29

实验二简单JavaScript的程序实现_第1页
实验二简单JavaScript的程序实现_第2页
实验二简单JavaScript的程序实现_第3页
实验二简单JavaScript的程序实现_第4页
实验二简单JavaScript的程序实现_第5页
资源描述:

《实验二简单JavaScript的程序实现》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、实验二简单JavaScript的程序实现、实验目的1)理解JavaScript的程序结构;2)掌握JavaScript的语法、数据类型和变量;3)理解JavaScript编程的流程控制;4)掌握JavavScript函数的使用。二.实验要求1)下述程序都有错误,请调试程序并观察效果。2)总结程序中使用了哪些控制方法和函数。3)在实验报告中写出每个程序实现的功能及程序错误所在,并加以纠正。三、实验内容1、验证程序1运行界面如下:代码如下:〈head〉functionclickalert(){alert(〃这是一个用了什么技术的警告框

2、画面!〃);}〈/script>看看这是什么?〈/body〉2、验证程序2运行界面如下:z3九九乗法表-MicrosoftInternetExplorer・1口1x

3、文件(巳编辑(或查看(刃收藏(①工具(D帮助(b)©后退▼O▼国団0Q搜素☆收藏夹创3地址(Q)

4、自D:WebExample2.htmF③目转到捱接》建▼这个程序可以打印出九九表如下:1*111*221*331*4=41*5=51*6=61*7=71*8=81*9=92*122*242*362*4=82*5=102*6=

5、122*7二142*8二162*9二183*133*263*393*4=123*5=153*6=183*7=213*8=243*9=274*144*284*3124*4二164*5二204*6二244*7=284*8二324*9二365*155*2105*3155*4=205*5=255*6=305*7=355*8二405*9二456*166*2126*3186*4=246*5=306*6=366*7=426*8二486*9二547*177*2147*3217*4二287*5二357*6二427*7二497*8二567*9二638*188*2168*3248*4=328*5=408*6=

6、488*7=568*8二648*9二729*199*2189*3279*4=369*5二459*6二549*7二639*8=729*9=81鬲完毕—「厂「厂口貓电脑乙代码如下:〈html>九九乘法表〈/title><scriptlanguage="JavaScript">document.write("这个程序可以打印宙九九表如下:<br>”);for(i二1;i<=9;i++){for(j=l;j<=9;j^){varnum二i*j;document,write(i,〃*",j,"二","num:"“);(引号去掉)document.writeC<br>9;<</p><p>7、/script>〈/head〉</html>3、验证程序3运行界面如下:文件(巳编辑(Q查看(S0收藏(①工具(D帮助(LDO启退▼j▼0固</p><p>8、J3:搜素二]地址(◎</p><p style="height:0px;padding:0;margin:0;overflow:hidden">9、於[D:阴ebE心mple6ht▼]I⑨^3转到链接parseint0转化后的数:289pairseFloat〔)转化后的数:289.45parseFloat()转化后的薮:289parseFloat()转化后的数:NaN代码如下:〈head〉<title>varstringl=289abvarstring2=^289.45ab";varstring

10、3二"abc";documcnt.writo("parseInt()转化后的数::parseint(stringl),"
〃);document.write("pnrseFloat0转化后的数:”,parseFloat(string2),"
");document.write("parseFloat0转化后的数::parseFloat(stringl),〃
〃);document.write(^parseFloat()转化后的数::parseFloat(string3));〈/script〉〈body〉4、验证程序4运行界面如下:我的电脑代码如下:〈htm

11、l>数组的使用〈/title></head>〈body〉<scriptlanguage^"JavaScript">//创建三个不同的数组vararrayl=newArray(1,2,3,4,5,6,7,8,9);vararray2=newArray(3);array2[0]二〃A";array2[1]二〃S〃;array2[2]="P”;vararray3=newArray();array3[0]=''Yo</p> </div> <div class="mt-3 bg-white"> <div class="d-lg-block d-none px-3 px-lg-4 py-3 border-bottom text-center font-18"> 当前文档最多预览五页,下载文档查看全文 </div> <div class="detail-fixed-feature d-none d-lg-block" id="detailFixedFeatureBox"> <div class="px-3 px-lg-4 py-3 d-flex align-items-center justify-content-between fixed-feature-box" id="detailFixedFeature"> <div class="d-lg-flex d-none align-items-center"> <div> <a class="btn btn-outline-danger article-state" href="javascript:;" data-id="41618655" data-code="438274" data-title="实验二简单JavaScript的程序实现"> <span>侵权申诉</span> </a> <button type="button" class="btn btn-outline-secondary with-light ml-2" data-toggle="modal" data-target="#reportModal" data-id="41618655"><span>举报</span></button> </div> <nav class="d-flex align-items-center ml-4" id="anchorPoint"> <a href="javascript:;" class="btn btn-light anchor-pre px-2"><i class="iconfont text-muted"></i></a> <div class="text-muted mb-0 pre-point-list" id="prePointList"> <a class="px-2 active nav-link" href="#anchorImg0">1</a> <a class="px-2 nav-link" href="#anchorImg1">1</a> <a class="px-2 nav-link" href="#anchorImg2">2</a> <a class="px-2 nav-link" href="#anchorImg3">3</a> <a class="px-2 nav-link" href="#anchorImg4">4</a> <a class="px-2 nav-link" href="#anchorImg5">5</a> / <span class="px-2" id="prePageNums">10</span> </div> <a href="javascript:;" class="btn btn-light anchor-next px-2"><i class="iconfont text-muted"></i></a> </nav> </div> <div class="d-flex align-items-center"> <p class="d-lg-block d-none font-14 text-black-50 mb-0 mr-2">此文档下载收益归作者所有</p> <button class="btn btn-danger detail-download-btn px-3 ml-0 font-16" data-btn="downloadfile" style="width:128px;height:40px;" data-id="41618655" data-price="2000" data-size="117.41 KB" data-page="10页" data-type="docx" data-binddown="true" data-isold="new_content" data-vip="0" data-title="实验二简单JavaScript的程序实现">下载文档</button> </div> </div> </div> </div> <div class="d-block d-lg-none px-3 px-lg-4 py-3 border-bottom text-center font-14" style="color:#999">当前文档最多预览五页,下载文档查看全文</div> <button class="btn d-block w-100 d-lg-none btn-danger detail-download-btn px-3 ml-0 font-16" data-btn="downloadfile" data-id="41618655" data-price="2000" data-size="117.41 KB" data-page="10页" data-type="docx" data-binddown="true" data-isold="new_content" data-vip="0" data-title="实验二简单JavaScript的程序实现">点击下载本文档 </button> </div> <div class="px-3 px-lg-4 py-3 bg-white mt-3"> <ul class="nav custom-tab border-bottom" id="myTab" role="tablist"> <li class="nav-item" role="presentation"> <a class="nav-link active px-0 mr-4 font-16 font-weight-light pb-3" id="tips-tab" data-toggle="tab" href="#showTips" role="tab" aria-controls="showTips" aria-selected="true">版权提示</a> </li> <li class="nav-item" role="presentation"> <a class="nav-link px-0 pb-3 font-16 font-weight-light text-black-50" href="/d-41618655.html" >下载文档</a> </li> <dl class="flex-grow-1 mb-0 d-lg-none"> <li class="ml-3 float-right d-lg-none"> <button type="button" class="btn btn-light" data-toggle="modal" data-target="#reportModal" data-id="41618655"><span>举报</span></button> </li> </dl> </ul> <div class="tab-content with-content pt-3" id="myTabContent"> <div class="tab-pane fade show active font-14" id="showTips" role="tabpanel" aria-labelledby="showTips-tab"> 温馨提示: <br> 1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。<br> 2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。<br> 3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。<br> 4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。 <br> </div> </div> </div> </div> <div class="detail-sidebar d-none d-lg-block"> <div id="columnDetailSiderRight"> <div class="detail-yourlike mt-0 pb-2" id="relativeArticle"> <div class="border-bottom py-2 d-flex align-items-center justify-content-between"> <h5 class="font-16">相关文章</h5> <a class="font-14 hover-letter-spacing" href="/ucenter/search/index.html?text=实验二简单JavaScript的程序实现" target="_blank" rel="nofollow">更多<i class="iconfont font-12 pl-1"></i></a> </div> <ul class="font-14 like-list"> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-6136043.html" title="实验10+javascript简单脚本程序设计" target="_blank"><span class="text-danger">实</span><span class="text-danger">验</span>10+j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">简</span><span class="text-danger">单</span>脚本<span class="text-danger">程</span><span class="text-danger">序</span>设计</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-27820326.html" title="javascript程序中实现继承特性的方式总结" target="_blank">j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">程</span><span class="text-danger">序</span>中<span class="text-danger">实</span><span class="text-danger">现</span>继承特性<span class="text-danger">的</span>方式总结</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-30511183.html" title="基于javascript实现简单的抽奖系统" target="_blank">基于j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">实</span><span class="text-danger">现</span><span class="text-danger">简</span><span class="text-danger">单</span><span class="text-danger">的</span>抽奖系统</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-30511213.html" title="基于javascript实现表格的简单操作" target="_blank">基于j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">实</span><span class="text-danger">现</span>表格<span class="text-danger">的</span><span class="text-danger">简</span><span class="text-danger">单</span>操作</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-30768837.html" title="javascript基础_嵌入图像的简单实现_基础知识" target="_blank">j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span>基础_嵌入图像<span class="text-danger">的</span><span class="text-danger">简</span><span class="text-danger">单</span><span class="text-danger">实</span><span class="text-danger">现</span>_基础知识</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-30775905.html" title="javascript实现图片轮播效果(二)图片序列节点的控制实现_javascript技巧" target="_blank">j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">实</span><span class="text-danger">现</span>图片轮播效果(<span class="text-danger">二</span>)图片<span class="text-danger">序</span>列节点<span class="text-danger">的</span>控制<span class="text-danger">实</span><span class="text-danger">现</span>_j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span>技巧</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-33868559.html" title="实验五 javascript密码验证的实现" target="_blank"><span class="text-danger">实</span><span class="text-danger">验</span>五j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span>密码<span class="text-danger">验</span>证<span class="text-danger">的</span><span class="text-danger">实</span><span class="text-danger">现</span></a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-35342272.html" title="实验三基于socket的简单程序实现" target="_blank"><span class="text-danger">实</span><span class="text-danger">验</span>三基于so<span class="text-danger">c</span>ke<span class="text-danger">t</span><span class="text-danger">的</span><span class="text-danger">简</span><span class="text-danger">单</span><span class="text-danger">程</span><span class="text-danger">序</span><span class="text-danger">实</span><span class="text-danger">现</span></a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-37922410.html" title="javascript程序设计实验1" target="_blank">j<span class="text-danger">a</span><span class="text-danger">v</span><span class="text-danger">a</span>s<span class="text-danger">c</span><span class="text-danger">r</span><span class="text-danger">i</span><span class="text-danger">p</span><span class="text-danger">t</span><span class="text-danger">程</span><span class="text-danger">序</span>设计<span class="text-danger">实</span><span class="text-danger">验</span>1</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-ppt" href="/p-51339644.html" title="实验三:实现简单的Shell 程序教学教案.ppt" target="_blank"><span class="text-danger">实</span><span class="text-danger">验</span>三:<span class="text-danger">实</span><span class="text-danger">现</span><span class="text-danger">简</span><span class="text-danger">单</span><span class="text-danger">的</span><span class="text-danger">S</span>hell<span class="text-danger">程</span><span class="text-danger">序</span>教学教案.<span class="text-danger">p</span><span class="text-danger">p</span><span class="text-danger">t</span></a> </li> </ul> </div> <div class="detail-yourlike pb-2"> <div class="border-bottom py-2"> <h5 class="font-16">相关标签</h5> </div> <ul class="font-14 like-list d-flex flex-wrap"> <a class="search-tag" href="/tags/718137/" target="_blank">程序实现</a> <a class="search-tag" href="/tags/14/" target="_blank">JavaScript</a> <a class="search-tag" href="/tags/540408/" target="_blank">实验</a> <a class="search-tag" href="/tags/542042/" target="_blank">简单</a> </ul> </div> <script src="/d/js/acmsd/thea1.js"></script> </div> </div> </div> <footer> <div class="container d-none d-lg-block mb-4"> <div class="d-flex justify-content-between footer-nav"> <ul class="d-flex foot-nav"> <li> <h5>常见问题</h5> <a class=text-decoration-none href=/help/wenti/upload/ target=_blank> 关于上传 </a><a class=text-decoration-none href=/help/wenti/xiazai/ target=_blank> 关于下载 </a><a class=text-decoration-none href=/help/wenti/qinquan/ target=_blank> 关于侵权 </a><a class=text-decoration-none href=/help/wenti/fenxaing/ target=_blank> 分享文档赚钱教程 </a> </li> <li> <h5>关于我们</h5> <a class=text-decoration-none href=/help/about/wzjs/ target=_blank> 网站介绍 </a><a class=text-decoration-none href=/help/about/gywm/ target=_blank> 关于我们 </a><a class=text-decoration-none href=/help/about/lxwm/ target=_blank> 联系我们 </a> </li> <li> <h5>版权问题</h5> <a class=text-decoration-none href=/help/banquan/bqsm/ target=_blank> 版权声明 </a><a class=text-decoration-none href=/help/banquan/qqcl/ target=_blank> 侵权处理 </a><a class=text-decoration-none href=/help/banquan/mzsm/ target=_blank> 免责声明 </a> </li> <li> <h5>协议条款</h5> <a class=text-decoration-none href=/help/xieyi/yhxy/ target=_blank> 用户协议 </a><a class=text-decoration-none href=/help/xieyi/fwtk/ target=_blank> 用户服务条款 </a><a class=text-decoration-none href=/help/xieyi/ysbh/ target=_blank> 用户隐私保护 </a> </li> <li> <h5>网站导航</h5> <a class="text-decoration-none help-nav-item" href="/sitemaps.xml" data-name="网站地图" target="_blank">网站地图</a> <a class="text-decoration-none help-nav-item" href="/list.html" data-name="全部分类" target="_blank">全部分类</a> <a class="text-decoration-none help-nav-item" href="/sitemaps/index.html" data-name="资源地图" target="_blank">资源地图</a> </li> </ul> <div class="foot-qrcode d-flex"> <div> <div class="subsitute-bg"><img src="https://www.wenku365.com/d/file/2022/07-08/f23df57d987ef7ad9acb33fe5abf9854.jpg"></div> <p>关注公众号<br></p> </div> </div> </div> </div> <div class="footer-copyright"> <p><a href="/" target="_blank">天天文库</a>站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有【成交的100%(原创)】。</p> <p>本站是网络服务平台方,若您的权利被侵害,侵权客服QQ:3074922707 欢迎举报。</p> <p>Copyright 2004-2021 <a href="https://www.wenku365.com/" target="_blank">wenku365.com</a> All Rights Reserved <a href="https://beian.miit.gov.cn/#/Integrated/index" rel="nofollow" target="_blank">闽ICP备15016911号-5 </a></p> <p>闽公网安备 <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=35052402000320" rel="nofollow" target="_blank">35052402000320</a></p> <p> <a href="https://www.wenku365.com/zt.html" target="_blank">专题文集</a> <a href="https://www.wenku365.com/zt-90007.html" target="_blank">丨职业培训</a> <a href="https://www.wenku365.com/zt-90005.html" target="_blank">丨实用范文</a> <a href="https://www.wenku365.com/zt-90010.html" target="_blank">丨商业材料</a> <a href="https://www.wenku365.com/zt-90013.html" target="_blank">丨合同协议</a> <a href="https://www.wenku365.com/zt-90009.html" target="_blank">丨PPT专题</a></p> </div> </footer> <script src="//static.wenku365.com/wenku365/js/global.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/clipboard.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/jquery.treeview.js?"></script> <script src="//static.wenku365.com/wenku365/js/jquery.share.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/common.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/downloadFile.js?"></script> <script src="//static.wenku365.com/wenku365/js/loginWindow.js?"></script> <script src="//static.wenku365.com/wenku365/js/windowRecharge.js?"></script> <script src="//static.wenku365.com/wenku365/js/viewer.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/detail.js?"></script> <!-- 2023-05-07 09:24:38 --> </body> </html>