zoukankan      html  css  js  c++  java
  • JavaScript: The Definitive Guide, 6th Edition Chapter 1 Note 1 Kevin

    1.2 Client-Side JavaScript:

    confirm()函数:用于弹出确认对话框,setTimeout()函数用于,设置超时时间。

    	<script type="text/javascript">
    			function moveon()
    			{
    				var answer = confirm("Ready to move On?");
    				if(answer)
    				{
    				  window.location = "Http://Google.com";
    			  }
    			};
    			
    			setTimeout(moveon,6000);
    		</script>
    

      confirm 拼写错误将导致程序不能正常运行。

    2.The Example demonstartes a number of core JavaScript language features, and also demonstares important client-side JavaScript techniques:

         1.How to find elements in a document.

         2.How to get user input from form input elements

         3.How to set the HTML content of document elements.

         4.How to store data in browser.

         5.How to make scripted HTTP requests.

         6.How to draw graphics with the <canvas> element.

    If a line break appears after any of these words(before any other tokens),JavaScript will always interpret 

    that line break as a semicolon.For example,if you write:

    Return 
    
    true;
    

      JavaScript assumes you meant:

    return; true;
    

      However,you probably meant:

    return true;
    

      What this means is that you must not insert a line break between retrun,break,or continue and the expression that follows the keyword.If you do insert a line break,your code is likely to failin a nonobvious way that is difficult to debug.

  • 相关阅读:
    nginx负载均衡
    docker 使用之管理工具shipyard(五)
    docker使用之私有仓库构建(四)
    docker使用之dockerfile手动构建镜像(三)
    docker 使用之网络和存储(二)
    docker部署和使用(一)
    Java微信公众号开发
    Java实现验证码的制作
    SSH框架-Struts2基础-Action
    Java算法
  • 原文地址:https://www.cnblogs.com/kfx2007/p/2642729.html
Copyright © 2011-2022 走看看