JavaScript for .NET Developers
eBook - ePub

JavaScript for .NET Developers

  1. 390 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

JavaScript for .NET Developers

About this book

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.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

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...

Table of contents

  1. JavaScript for .NET Developers

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access JavaScript for .NET Developers by Ovais Mehboob Ahmed Khan in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over one million books available in our catalogue for you to explore.