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.

  • 相关阅读:
    Anaconda设置虚拟环境并打包exe
    [转]Anaconda, conda, pyenv, virtualenv的区别
    [闲记]2020-2-13
    集合笔记
    Python_列表(list)
    LeetCode 1711. 大餐计数 做题小结
    LeetCode 242. 有效的字母异位词 做题小结
    GitHub Actions教程 使用selenium自动化
    LeetCode 5641. 卡车上的最大单元数 做题小结
    git 批量删除文件夹和文件
  • 原文地址:https://www.cnblogs.com/kfx2007/p/2642729.html
Copyright © 2011-2022 走看看