JavaScript基础

本文介绍了JavaScript的基础知识,包括它作为客户端脚本语言的角色,由ECMAScript、DOM和BOM组成的组成部分,以及如何在HTML中嵌入JS。此外,还详细讲解了JS的注释、分号使用、变量声明与赋值以及标识符的命名规则,是初学者理解JavaScript语法的良好起点。
摘要由CSDN通过智能技术生成

一.什么是JavaScript

       JavaScript是一种基于对象和事件驱动的客户端脚本语言,最初的设计是为了检验HTML表单输入的正确性,起源于Netscape公司的LiveScript语言。      

二.JavaScript的组成部分

      完整的JavaScript是由ECMAScript(语法)、Brower Objects(DOM、BOM)(特性)组成的。

三.在HTML中使用JavaScript

       在<head></head>和<body></body>标签中都可以使用<script></script>

四.JavaScript的基本语法

      1. 掌握JS的注释与分号

          //  单行注释

          /**/  多行注释

          语句结束使用分号,如果省略,则由解析器确定语句的结尾。

      2. 掌握JavaScript的语法

          JavaScript中的一切(变量、函数名和操作符)都区分大小写。

      3. 掌握标识符

        (1)什么是标识符?

                 变量、函数、属性的名字,或者函数的参数。

        (2)标识符的命名规则:

                  a.  由字母、数字、下划线(_)或者美元符号($)组成。

                  b.

      4. 掌握什么是变量

      5. 掌握变量的声明与赋值

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Summary Third-Party JavaScript guides web developers through the complete development of a full-featured third-party JavaScript application. You'll learn dozens of techniques for developing widgets that collect data for analytics, provide helpful overlays and dialogs, or implement features like chat or commenting. The concepts and examples throughout this book represent the best practices for this emerging field, based on thousands of real-world dev hours and results from millions of users. About this Book There's an art to writing third-party JavaScript—embeddable scripts that can plug into any website. They must adapt easily to unknown host environments, coexist with other applications, and manage the tricky security vulnerabilities you get when code and asset files are served from remote web addresses. Get it right and you have unlimited options for distributing your apps. This unique book shows you how. Third-Party JavaScript guides you through the ins and outs of building full-featured third-party JavaScript applications. You'll learn techniques for developing widgets that collect data for analytics, provide helpful overlays and dialogs, or implement features like chat and commenting. The concepts and examples throughout the book represent the best practices for this emerging field, based on thousands of real-world dev hours and results from millions of users. Written for web developers who know JavaScript, this book requires no prior knowledge of third-party apps. What's Inside Writing conflict-free JavaScript, HTML, and CSS Making cross-domain requests from the browser How to overcome third-party cookie limitations Security vulnerabilities of third-party applications Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Authors Ben Vinegar is an engineer at Disqus, a third-party JavaScript commenting platform. Anton Kovalyov is a software engineer at Mozilla. They are third-party applications experts whose work has been distributed on millions of websites Table of Contents Introduction to third-party JavaScript Distributing and loading your application Rendering HTML and CSS Communicating with the server Cross-domain iframe messaging Authentication and sessions Security Developing a third-party JavaScript SDK Performance Debugging and testing
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值