Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Javascript Concepts: 1St Edition
Javascript Concepts: 1St Edition
Javascript Concepts: 1St Edition
Ebook227 pages2 hours

Javascript Concepts: 1St Edition

Rating: 0 out of 5 stars

()

Read preview

About this ebook

This book is about understanding the concepts of JavaScript as a language and then applying these concepts to develop dynamic Web pages using JavaScript.

The first objective of this book is to make it easy to write JavaScript solutions to a programming problem. Debugging and correcting your code quickly also becomes very easy at that point.

The second objective is to enable you to apply these concepts on another challenging language, like Java, C#.

Finally, I can promise you that by the time you finish reading this book and practice the exercises, you will become a master of JavaScript and ready to take on the next JavaScript challenge.
LanguageEnglish
PublisherAuthorHouse
Release dateJun 16, 2017
ISBN9781524694463
Javascript Concepts: 1St Edition
Author

Mohammed Ashequr Rahman

Mohammed Ashequr Rahman is an adjunct professor at New York University’s (NYU) for over 20 years. During the last 20 years he has taught various courses at NYU including Java, Advanced Java, Java Web Services, JavaScript and Visual Basic. He has published a book titled “JavaScript Concepts” that is being used as a text book for JavaScript classes. He has recently started teaching at Hofstra University. Mohammed has a MS in Computer Science from NYU and has been working in IT field for the last 30 years. He also has an MBA with a Finance major from SUNY, Stony Brook. Mohammed is certified Project Management Professional and Oracle certified Java programmer.

Related to Javascript Concepts

Related ebooks

Computers For You

View More

Related articles

Reviews for Javascript Concepts

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Javascript Concepts - Mohammed Ashequr Rahman

    © 2017 Mohammed Ashequr Rahman. All rights reserved.

    No part of this book may be reproduced, stored in a retrieval system, or transmitted by any means without the written permission of the author.

    Published by AuthorHouse 06/16/2017

    ISBN: 978-1-5246-9445-6 (sc)

    ISBN: 978-1-5246-9446-3 (e)

    Any people depicted in stock imagery provided by Thinkstock are models,

    and such images are being used for illustrative purposes only.

    Certain stock imagery © Thinkstock.

    Because of the dynamic nature of the Internet, any web addresses or links contained in this book may have changed since publication and may no longer be valid. The views expressed in this work are solely those of the author and do not necessarily reflect the views of the publisher, and the publisher hereby disclaims any responsibility for them.

    18449.png

    Contents

    Section A – JavaScript Language

    Chapter 1

    Data Types in JavaScript

    JavaScript and Browser Console

    Variable Naming Convention

    Arithmetic Operations

    Commenting your code

    Conditional Operation

    Truthy and Falsy in JavaScript

    Undefined on the Console

    Embedding JavaScript in an HTML file

    JavaScript Debugging

    Loops

    Chapter 2

    What is a Function?

    Default values of parameters

    Invalid parameters

    Converting a no parameter function into an unlimited parameter function

    Variable Scope in JavaScript – Global vs. Local Variables

    Global Disaster in JavaScript

    Parameter Passing, Pass By Value

    Function as Variable

    Chapter 3

    Arrays

    For-in loop

    Arrays Functions (methods)

    Function as Parameter and forEach loop

    Function as Parameter and Number Sorting In Array

    What is object?

    Object and []

    Object and for-in loop

    Methods

    Object containing Object

    Constructor

    Methods on Prototype of Constructor

    instanceof Operator

    Parameter Passing, Pass By Reference

    Array as Object

    Function as Object:

    String, Number, Boolean Object

    Regular Expression

    Section B – JavaScript and HTML

    Chapter 4

    What is HTML?

    What is HTTP?

    Fiddler Tool

    Tomcat

    Abyss

    What is DOM?

    HTML DOM and JavaScript

    Modifying DOM impacts the HTML page

    Chapter 5

    Getting to Elements in DOM using JavaScript

    HTML tags –

    and tag

    Programmatic

    submission

    Checkbox and Validation

    Radio Button and Validation

    Dropdown and Validation

    List and Validation

    TextArea

    Chapter 6

    Getting to know Events

    Event Handling Options

    Cancelling Event – preventDefault()

    DOMContentLoaded Event

    Event Bubbling

    this vs Event.target

    Event Capturing

    Canceling the Bubbling

    Use of Bubbling

    Creating Tabs on a page

    Chapter 7

    XML Parsing and Serialization

    JSON (JavaScript Object Notation)

    AJAX (Asynchronous JavaScript and XML)

    AJAX and XML

    AJAX and JSON

    Chapter 8

    Slideshow

    Appending Nodes in DOM

    Inserting Before

    Deletion

    Dynamic Delete Button

    Dynamic Table

    Dynamic Photo Gallery

    Section C - JQuery

    Chapter 9

    What is JQuery?

    Why JQuery?

    How to get JQuery?

    How to include any JavaScript file in your html?

    How do you include JQuery JavaScript file in your html?

    What function in JQuery’s .js file can I call?

    How to use JQuery?

    JQuery Selectors

    JQuery Append

    JQuery inserting innerHTML

    JQuery adding and removing event handler

    JQuery AJAX

    $.each() function in JQuery

    Preface

    This book is about understanding of the concepts of JavaScript as a language and then applying these concepts to develop dynamic web pages using JavaScript.

    The first objective of this this book is to make it easy to write JavaScript solutions to a programming problem. Debugging and correcting your code quickly becomes also very easy at that point.

    The second objective is to enable you to apply these concepts on another challenging language like Java, C#.

    Finally, I can promise you that by the time you finish reading this book and practice the exercises, you will become a master of JavaScript and ready to take on the next JavaScript challenge.

    About the Author

    Mohammed Ashequr Rahman is an adjunct professor at New York University’s (NYU) for over 20 years. During the last 20 years he has taught various courses at NYU including JavaScript, Java and Visual Basic.

    He has recently started teaching JavaScript at Hofstra University.

    Mohammed has a MS in Computer Science from NYU and has been working in IT field for the last 29 years.

    He is also finishing up his MBA with a Finance major at SUNY, Stony Brook.

    Mohammed is certified PMP and Oracle certified Java programmer.

    Introduction

    This book is broken down into 3 fundamental sections. In the first section, we will learn JavaScript as a language. In the second section, we will learn how to use JavaScript with the web pages to generate dynamic content. In the third section, we will learn how to use JQuery, the most popular JavaScript libraries.

    You can download all the examples in the book from the following url:

    https://drive.google.com/file/d/0BzE52XmaCfzuTjBNd1RQNTYzd1k/view?usp=sharing

    Section A – JavaScript Language

    Chapter 1

    Why JavaScript?

    JavaScript is the language of the web. Even a modest web application has tons of JavaScript in it.

    JavaScript is simple, easy to learn. It lets you make tons of mistakes and easily recover from them. It’s awesome!

    JavaScript Interpreter

    We generally write a computer program using a high-level language like JavaScript. A high-level language is one which is understandable by us humans. It contains words and phrases from the English language. But a computer does not understand English. It only understands program written in 0’s and 1’s in binary, called the machine code. So, a program written in English like high level language needs to be translated to machine code.

    A program written in high-level language is called a source code. We need to convert the source code into machine code and this is accomplished by either a) compilers or b) interpreters.

    Hence, a compiler or an interpreter is something that converts source code written in high-level language into machine code understood by the computer.

    Language like C, C++, and Pascal uses compiler to do the job. A compiler converts all the source code to machine code at once and hides the source code as intellectual property of the company. Hence users never get to see the source code. A compiler is like a person translating your written lecture from English to German.

    JavaScript, on the other hand, uses Interpreter instead. An Interpreter converts source code to machine code one line at a time. An interpreter is like a person who translates your verbal lecture from English to German as you speak.

    One side effect of using interpreter is that the source code is open to public. Your browser downloads the JavaScript source code and runs as Interpreter. Therefore, JavaScript source code is wide open to public. We can learn a lot from JavaScript written by other people.

    JavaScript Editor

    Download Sublime Text latest version. This is our JavaScript editor for now. We can write JavaScript Code here and then run them on Browser Console.

    Browsers

    Browser 1) Get Chrome Canary. This version of Chrome is updated almost daily. However, regular Chrome would work just fine. Click on the vertical bar with dots on the top right, select More Tools

    Enjoying the preview?
    Page 1 of 1