Introduction
I want to thank you and congratulate you for downloading the book , Javascript Programmin g !
This book contains proven steps and strategies that even beginners can use in order to code from scratch. Even better, intermediate systems and tutorials are included so that those who are already familiar with Javascript can amp up their game and use JavaScript in conjunction with more advanced tools and systems.
This book includes a short introduction to the programming language so that youll know exactly what to expect. You will then be guided through the basics, including variables, identifiers and statements. You will also get oriented regarding javascript syntax. Several guides and samples are also included so that youll see exactly how certain keywords and data will appear on webpages.
Dont worry because to learn Javascript, there is no need for you to pay for other third-party software and tools. All you need is Notepad, or TextEdit if you are using a Mac computer. When you move on to the intermediate stages though, it would be better for you to use a source code editor that offer HTML and CSS support, such as Notepad ++.
Thanks again for downloading this book. I hope you enjoy it!
Chapter 1: JavaScript 101
JavaScript is a client-side scripting language. It is used to improve website or webpage functionality. Also, it is used in conjunction with HTML and CSS to create responsive websites.
JavaScript is one of many client side-scripting languages (e.g., VBScript, PerlScript, Jscript, ActionScript) that exist in the web. However, it is the most popular and widely used. Due to its wide usage, it has spawned multiple frameworks. Frameworks are there to make coding easier. They also improve and enhance the functionality of languages. JavaScript frameworks will be discussed in the later parts of this book.
On the other hand, this scripting language is behind many website features and additional functions on the web. It is safe to say that compared to other languages, JavaScript is the most used in the world. With almost every website employing this programming language in every page it has, without a doubt, its absence will make the Internet boring.
Aside from that, JavaScript is cross platform and it is a useful tool in creating impromptu programs and macros. Due to the mass availability of browsers in every computer and smart devices, you can easily create a decent program with the use of a text-editing program and a web browser.
Frequently Asked Questions
Before you go ahead on learning JavaScript, take some time to read this small FAQ section. The information listed here may clear up some misunderstanding and misconceptions about this scripting language.
Is It Compatible to All Web Browsers?
Despite being standardized, be wary that browsers may behave or perform differently in some codes or cases. In addition, JavaScript also has a server side-scripting version. It provides more power to its client side scripting. However, do note that this book will only tackle the client-side scripting version.
Nevertheless, most browsers support JavaScript, and the ones you use will certainly understand scripts written in JavaScript. By the way, this book prefers the use of Google Chrome. You can get Google Chrome from Google.com. However, the usage of other browsers is not discouraged so long as they have a web developer console, which will be discussed later.
Is It Related to the Java Programming Language?
It is not directly related to Java. Although, the way you code JavaScript resembles Java. There are also some familiar terms and keywords that are present in JavaScript and Java. Nevertheless, both are different from each other.
As a fun tidbit, JavaScript is derived and standardized with ECMAScript by Netscape. JavaScript has undergone multiple name changes before. Primarily, ECMAScript was not used because it sounded like a skin disease, according to ECMAScripts developer, Brendan Eich.
Also, do not confuse JavaScript with JScript. JScript is Microsofts version of the ECMAScript. However, JavaScript and JScript are relatively the same. It was just used to prevent a trademark issue between Microsoft and Sun Microsystems, the company that developed Java.
Is It Difficult to Learn and Understand?
Not really. Nevertheless, the difficulty of learning and understanding JavaScript hugely depends on your goal and reasons. Why are you trying to learn JavaScript anyway?
If you are reading this book to learn how to create web forms and minor scripts, then you will not need to read everything. Alternatively, if you are trying to learn how to create dynamic pages, then you will need to understand everything in here, but you will not have a hard time processing the lessons included in this book.
However, if you are attempting to build web applications and add custom and advanced functionalities on your page, then this book will only serve as a precursor to the things you need to learn. Not to mention that, if you are not familiar with programming, you will need to require yourself to master this book.
Do I Need Programming Experience?
For those who have no idea with programming, this book will help you get your bearings. Instead of the usual dive to inserting JavaScript in HTML code, you will be first introduced to using a development console, which will be discussed later.
How Do Browsers Process JavaScript?
A few of you might not be familiar with the processes behind the scenes when a browser loads a page. If you are one of them, then give yourself some time to process this section.
Client and Server Concept
Simply put, when you access a webpage on the Internet, two entities play major roles in order to deliver you the content that you need. First is the client. Second is the server. Of course, the connection between the two is essential, but it will be discussed thoroughly here.
The client is your machine/computer/device that you use to access the web. Of course, you, as the user, and the browser is part of the client.
The server, on the other hand, is the computer that stores and provides clients the content that they need. The connection between the client and server is provided by an Internet connection, usually.
The location and the server itself changes depending on the content you demand. The server can be on the web, within your local area connection, and can even be your computer.
If you are just going to access a regular webpage, these things will happen:
- Your browser will send a request to the server for the content
- The server will process the request and find the content needed
- The server will sent the content back to the client
- The client will process the content and render it to your screen
Out of the four (broad) processes, this section will focus on the fourth one.
Setting Expectations and Prerequisites
Learning JavaScript requires basic knowledge of HTML and CSS. Knowledge in programming is not required since basic programming and programming JavaScript scripts will be included in this book. Aside from that, you must be at least familiar with how the web works.
Supplementary Education
Of course, this book is not the only helpful resource you can use to learn JavaScript. Multiple websites and organizations provide insightful and direct information regarding this subject.