万本电子书0元读

万本电子书0元读

顶部广告

JavaScript for .NET Developers电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Ovais Mehboob Ahmed Khan

出  版  社:Packt Publishing

出版时间:2016-07-01

字       数:1008.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Unlock the potential of evergreen browsers and increase the efficiency of your ASP.NET applications by learning how to write JavaScript About This Book Boost your skillset and start bringing JavaScript into your web development projects Leverage your existing ASP.NET knowledge to develop dynamic and responsive SPAs Learn effective design patterns for sustainable, and scalable web development Who This Book Is For This book is for ASP.NET developers that want to bring JavaScript into their skillset to build applications that are truly dynamic and responsive. It's for developers who are focused on developing for users who want to deliver a great end product and a fantastic experience. What You Will Learn Get to grips with the basic to advanced concepts of JavaScript Learn how to use JavaScript on server side using Node.js Develop web applications in ASP.NET using JavaScript Get to know with industry-wide best practices and design patterns that provide maintainability and scalability Build an ASP.NET application using Angular 2 with TypeScript and Web API Explore WinJS and see how to use mobile capabilities from web applications Use JavaScript to develop scalable ASP.NET applications See how to test and debug JavaScript In Detail If you want to improve responsiveness or the UX in your ASP.NET applications, JavaScript can be a life saver. In an age where server-side operations have shifted to the client, being able to handle JavaScript with confidence and fluency is vital for ASP.NET developers. There’s no point trying to fight it, so start learning with this book. Make sure your projects exceed user expectations. Begin by getting stuck into the basics of JavaScript, and explore the language in the context of ASP.NET Core. You’ll then find out how to put the principles into practice, as you learn how to develop a basic ASP.NET application using Angular 2 and TypeScript. You’ll also develop essential skills required to develop responsive apps, with a little help from AJAX, ensuring that you’re building projects that can be easily accessed across different devices. With guidance on Node.js and some neat techniques to test and debug a range of JavaScript libraries in Visual Studio, you’ll soon be well on your way to combining JavaScript with ASP.NET in a way that’s capable of meeting the challenges of modern web development head-on. Style and approach This book will build the skillset of every .NET developer, so they can build stronger and more responsive web apps with confidence.
目录展开

JavaScript for .NET Developers

Table of Contents

JavaScript for .NET Developers

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. JavaScript for Modern Web Applications

Importance of JavaScript

What is JavaScript?

Comparing runtimes

Setting up your environment

New editing experience of JavaScript in Visual Studio 2015 IDE

Programming in JavaScript

Core fundamentals of JavaScript

Adding JavaScript to an HTML page

Statements in JavaScript

Literals and variables

Data types

Array in JavaScript

What is JSON?

Simple objects in JSON

Declaring arrays in JSON

Nesting data in JSON

Conversions in data types

Elements of JavaScript

Constants in JavaScript

Comments

Case sensitivity

Character set

Expressions

The this keyword

Sequence of code execution in JavaScript

Using the this keyword on a calling method

The function statement and expression

Class statement and expression

Grouping operator

new

super

Operators

Assignment operators

Arithmetic operators

Unary operators

Comparison operators

Strict equal operator

Strict not equal operator

Logical operators

Logical AND

Logical OR

Logical NOT

Bitwise operators

Bitwise AND

Bitwise OR

Bitwise NOT

Bitwise XOR

Bitwise shift operators

Bitwise left shift

Bitwise right shift

The typeof operator

The void operator

The delete operator

Miscellaneous operators

Conditional operators

Spread operator

Built-in display methods in JavaScript

Displaying messages

Alert box

Confirm box

Prompt box

Writing on a page

Writing into the browser's console window

Browser Object Models in JavaScript

Window

Document

Navigator

Properties

Screen

Properties

History

Methods

Location

Properties

Methods

Summary

2. Advanced JavaScript Concepts

Variables – scope and hoisting

Declaring let

Conditions where let is efficient to use

Functions in loops

Events in JavaScript

Function arguments

Object-oriented programming in JavaScript

Creating objects

Defining objects using object literal notation

Defining objects using a constructor pattern

Using the class keyword

Properties

Defining properties using object literal notation

Defining properties using a constructor pattern

Defining properties using setters/getters in ECMAScript 6

JavaScript property descriptors

Display property descriptors

Managing property descriptors

Using getters and setters

Methods

Defining methods through object literal notation approach

Defining objects using the constructor function approach

Extending properties and methods

Private and public members

Inheritance

Chaining constructors in JavaScript

Inheritance using Object.create()

Predefined properties of Object.create()

Defining inheritance using class

Encapsulation

Abstraction

new.target

Namespace

Exception handling

Error

RangeError

ReferenceError

SyntaxError

TypeError

URIError

Closures

Practical use

JavaScript typed arrays

Typed array architecture

The array buffer

Creating a buffer

Maps, sets, weak maps, and weak sets

Maps and weak maps

Sets and weak sets

The strict mode

Summary

3. Using jQuery in ASP.NET

Getting started with jQuery

Using a content delivery network

The use of CDN

The document ready event

The jQuery selectors

Selecting the DOM elements using the ID

Selecting the DOM elements using TagName

Selecting nodes by the class name

Selecting by the attribute value

Selecting input elements

Selecting all the elements

Selecting the first and last child elements

The contains selector in jQuery

Selecting the even and odd rows selectors

Manipulating DOM

Modifying an element's properties

Creating new elements

Removing elements and attributes

Event handling in jQuery

Registering events in jQuery

Binding events using on and off

Using the hover events

Summary

4. Ajax Techniques

Introducing Ajax

How Ajax works

Ajax requests using the classic XHR object

XHR methods

XHR events

XHR properties

Making an Ajax request using jQuery

jQuery.ajax()

Ajax properties

Pre-filtering Ajax requests

Setting default values for all future Ajax requests

Loading data through the get functions in jQuery

Using jQuery.get()

Using jQuery.getJSON()

Using jQuery.getScript()

Posting data to server using the post function

Ajax events

Local events

Global events

Cross-origin requests

JSON-P

Using JSON-P

CORS

Specifying the CORS policy at services level

Enable CORS at the Configure method

Calling WCF services from JavaScript

Summary

5. Developing an ASP.NET Application Using Angular 2 and Web API

TypeScript

Compilation architecture of TypeScript

Advantages of TypeScript

Superset of JavaScript

Support for classes and modules

Static type checking

ECMAScript 6 feature support

Optional typing

Declaring types in TypeScript

Core elements of TypeScript

Declaring variables

Types

Classes and interfaces

Defining interfaces

Deriving classes and interfaces

Generic classes

Functions

Generic functions

Iterators

Modules and namespaces

Introduction to Angular 2

Angular 2 architecture

Events of component life cycle

Modules

Components

Core properties of Angular 2 components

Templates and selectors

Inputs and outputs

Using inputs

Using outputs

Directives

Creating a simple Hello World directive

Structural directives

Attribute directive

Providers

Dependency injection in Angular

Routing in Angular

Developing a to-do application in ASP.NET Core

Creating a Common project

Creating a TodoServiceApp project

Enabling MVC in a Web API project

Installing Entity Framework

Adding AppSettings to store a connection string

Configuring AppSettings in the Startup class

Adding data access in Web API

Enabling CORS in the ASP.NET Web API

Running database migration

Creating a controller

Creating a TodoWebApp project

Configuring Angular 2 in the TodoWebApp project

Dependencies

Development dependencies

Configuring TypeScript

Configuring Gulp

Adding Angular components

Adding the to-do service component

Adding a to-do view component

Creating the main to-do page

Creating a custom to-do tag helper

Adding a to-do MVC controller

Generating views for the TodoController action methods

Developing the Create Todo component

Summary

6. Exploring the WinJS Library

Introduction to WinJS

WinJS features

JavaScript coding and language patterns

Stylesheets

Windows runtime access

Security

App model

Databinding

Controls

Utilities

Usage of WinJS

Adding the WinJS library in the ASP.NET application

CDN

NPM

NuGet

Getting started with WinJS

Using WinJS in the ASP.NET application

Existing Windows app template in Visual Studio

Exploring WinJS core fundamentals

Classes and namespaces

Defining classes in WinJS

Deriving classes in WinJS

Namespaces in WinJS

Mixin

Events in WinJS

Databinding

One time databinding

One way databinding

Two way databinding

A databinding working model

Promises

Other operations of promises

Chaining promises and handling errors

Canceling promises

Joining promises

Checking promise

Wrapping non-promise into promise

Exploring WinJS controls and styles

Adding WinJS controls

Setting properties of WinJS controls

Using Windows runtime features

Hosted apps and accessing the camera

Creating the ASP.NET core application

Converting an ASP.NET application into Windows application using the Hosted app concept

Summary

7. JavaScript Design Patterns

Creational patterns

Singleton design pattern

Factory pattern

Abstract factory pattern

Prototype pattern

Structural patterns

Adapter pattern

Decorator pattern

Facade pattern

Bridge pattern

Behavioral pattern

Chain of responsibility pattern

Observer pattern

Pub/sub pattern

Promises

Summary

8. Node.js for ASP.NET Developers

Introduction to Node.js

Request processing by the Node.js web server

Comparison of Node.js with .NET

NPM

Installing Node.js

Using Node.js with Visual Studio 2015

Simple console application using Node.js

Web applications with Node.js

Creating blank Node.js applications

Using the Express framework for web applications in Node.js

Extend simple Node.js to use Express

Express view engines

EJS view engine

Jade view engine

Routing in the Express application

Middleware

MVC with the Express framework

MVC pattern

Creating a controller

Creating data services

Accessing the Microsoft SQL server in Node.js

Reading a record from the Microsoft SQL server database

Creating a record in the Microsoft SQL server database

Summary

9. Using JavaScript for Large-Scale Projects

Think before proceeding

Developing highly scalable and maintainable applications

Modularization

Implementing the module pattern

Modularizing JavaScript code through RequireJS

Creating modules using the RequireJS API

Bootstrapping RequireJS

Event-driven messaging

Implementing mediator pattern for communication between modules

Encapsulating complex code

Generating documentation

Installing JSDoc3 in ASP.NET Core

Adding comments

Deployment optimization

Summary

10. Testing and Debugging JavaScript

Testing the JavaScript code

Unit testing

Writing unit tests

Jasmine

Karma

Grunt

Developing unit test using Jasmine, Karma, and Grunt

Adding packages

Adding the Grunt file

Adding Karma specifications

Load npm task

Register task

Source JavaScript file

Adding unit test script file

Running test task

Implementing Model-View-ViewModel using Knockout and Run test

Adding the Knockout package

Adding ProductViewModel

Add the Product view

Modifying test configuration

Modifying the product-testing script

Debugging JavaScript

Debugging options in Visual Studio 2015

Debugging from Visual Studio with Internet Explorer

Debugging from Visual Studio with Google Chrome

Developer Tools

Debugging options in Microsoft Edge

Standard breakpoints

Conditional breakpoints

Tracepoints

Event

Add event tracepoint

Add event breakpoints

XHR

Debugging TypeScript

Debugger keyword supported by all browsers

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部