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.

  • 相关阅读:
    2018-9-4-Roslyn-通过-nuget-统一管理信息
    2018-9-4-Roslyn-通过-nuget-统一管理信息
    省赛前最后一次总结
    省赛前最后一次总结
    POJ 1845-Sumdiv(厉害了这个题)
    POJ 1845-Sumdiv(厉害了这个题)
    DP背包(一)
    DP背包(一)
    训练记录
    训练记录
  • 原文地址:https://www.cnblogs.com/kfx2007/p/2642729.html
Copyright © 2011-2022 走看看