• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Linford Xu

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2013年5月8日

JavaScript Objects
摘要: "Everything" in JavaScript is an Object: a String, a Number, an Array, a Function....In addition, JavaScript allows you to define your own objects.JavaScript ObjectsJavaScript has several built-in objects, like String, Date, Array, and more.An object is just a special kind of data, with pr 阅读全文
posted @ 2013-05-08 17:33 Linford Xu 阅读(251) 评论(0) 推荐(0)
 
The HTML DOM (Document Object Model)
摘要: With the HTML DOM, JavaScript can access all the elements of an HTML document.The HTML DOM (Document Object Model)When a web page is loaded, the browser creates a Document Object Model of the page.The HTML DOM model is constructed as a tree of ObjectsThe HTML DOM TreeWith a programmable object model 阅读全文
posted @ 2013-05-08 14:54 Linford Xu 阅读(245) 评论(0) 推荐(0)
 
JavaScript Errors - Throw and Try to Catch
摘要: The try statement lets you test a block of code for errors.The catch statement lets you handle the error.The throw statement lets you create custom errors.Errors Will Happen!When the JavaScript engine is executing JavaScript code, different errors can occur:It can be syntax errors, typically coding 阅读全文
posted @ 2013-05-08 14:32 Linford Xu 阅读(245) 评论(0) 推荐(0)
 
JavaScript Break and Continue
摘要: The Break StatementThe break statement can be used to jump out of a loop ora switch() statement.The break statement breaks the loop and continues executing the code after the loop (if any):Examplefor (i=0;i<10;i++) { if (i==3) { break; } x=x + "The number is " + i + "<br>&quo 阅读全文
posted @ 2013-05-08 14:18 Linford Xu 阅读(205) 评论(0) 推荐(0)
 
JavaScript Loops
摘要: Different Kinds of LoopsJavaScript supports different kinds of loops:for - loops through a block of code a number of timesfor/in - loops through the properties of an objectwhile - loops through a block of code while a specified condition is truedo/while - also loops through a block of code while a s 阅读全文
posted @ 2013-05-08 13:53 Linford Xu 阅读(222) 评论(0) 推荐(0)