JavaScript is a scripting language originally designed for web browsers but now used everywhere. It has dynamic typing and supports object-oriented, imperative, and functional programming. JavaScript was created in 1995 and standardized in 1999. It is now the most popular language on GitHub. JavaScript can be used to build interactive web pages, desktop applications, server-side applications, IoT applications, and real-time applications. The core data types in JavaScript are Number, String, Boolean, Object, Function, Array, Date, and Regular Expressions. JavaScript supports features like variables, flow control, error handling, debugging, and JSON for data exchange.
JavaScript is a scripting language that allows dynamic interactivity on web pages. It was invented by Brendan Eich and can be used to create image galleries, layout changes, and button click responses. JavaScript code can be placed between <script> tags in HTML documents or in external .js files. Some key features include client-side execution in web browsers, dynamic rendering variations across browsers, and potential security issues if not implemented carefully. Common uses of JavaScript include manipulating DOM elements, handling events, and validating forms.
Introduction to JavaScript course. The course was updated in 2014-15.
Will allow you to understand what is JavaScript, what's it history and how you can use it.
The set of slides "Introduction to jQuery" is a follow up - which would allow the reader to have a basic understanding across JavaScript and jQuery.
JavaScript - An Introduction is a beginner's guide to JavaScript. It starts with very basic level and goes to intermediate level. You'll be introduced with every language constructs, Event handling, Form handling and AJAX which is supported by JavaScript with XMLHttpRequest object. This XHR object is discussed in enough detail so that you can understand how the underlying AJAX functionality works in jQuery. At the end it discusses advance concepts and library build on/around JavaScript.
The document provides an overview of JavaScript programming. It discusses the history and components of JavaScript, including ECMAScript, the DOM, and BOM. It also covers JavaScript basics like syntax, data types, operators, and functions. Finally, it introduces object-oriented concepts in JavaScript like prototype-based programming and early vs. late binding.
JavaScript can dynamically manipulate the content, structure, and styling of an HTML document through the Document Object Model (DOM). The DOM represents an HTML document as nodes that can be accessed and modified with JavaScript. Common tasks include dynamically creating and adding elements, handling user events like clicks, and updating content by accessing DOM elements by their id or other attributes.
JavaScript variables hold values and are declared with var. Variable names are case sensitive and must begin with a letter or underscore. Variables can hold numbers, strings, Booleans, objects, and null values. Arrays are objects that hold multiple values in a single variable. Functions are blocks of code that perform tasks and are executed by events or calls. Objects store related data and functions to represent self-contained entities.
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
This document introduces JavaScript, explaining that it allows for interactivity on web pages by manipulating the browser and reacting to user actions. It is embedded in HTML and executes on the client side for fast interactions without a connection. JavaScript statements can include code combined with HTML tags. The document also discusses using JavaScript with HTML forms to process and display user input on the page.
JavaScript is a scripting language that can be inserted into HTML pages and used to program the behavior of web pages. It allows web pages to be dynamic and interactive. JavaScript code is placed between <script> and </script> tags and can manipulate HTML elements and write to the document. Variables, functions, conditional statements, and operators allow JavaScript code to run conditionally based on events or user input. JavaScript is case sensitive, uses semicolons, and has both local and global variables. Common data types include numbers, strings, arrays, and objects.
React is a JavaScript library for building user interfaces. It uses a component-based approach where UI is broken into independent, reusable pieces called components. Components are like functions that return markup describing part of a view. React uses a virtual DOM to efficiently update the real DOM by only making necessary changes. This improves performance by avoiding expensive DOM operations and minimizing DOM access. Components receive data and callbacks through properties and local state is updated using setState(), triggering a re-render of changed parts of the UI.
Objects in JavaScript can be created using object literals, the new keyword, or Object.create(). Objects are collections of properties and methods that are mutable and manipulated by reference. Arrays are objects that represent ordered collections of values of any type and are created using array literals or the Array constructor. Common array methods include concat, join, pop, push, reverse, and sort. The Math object provides common mathematical functions like pow, round, ceil, floor, random, and trigonometric functions.
This document is a presentation about JavaScript that covers what JavaScript is, where it came from, and what it can do. It introduces JavaScript as a scripting language that is easy to use and learn and runs in web browsers. The presentation explains that JavaScript is unrelated to Java but borrows some naming conventions. It provides overviews of JavaScript basics like variables, operators, and functions, as well as more advanced topics like objects, events, and DOM manipulation.
This document provides an overview of JavaScript and the DOM (Document Object Model) for a web programming course. It introduces JavaScript as a scripting language used to add interactivity to HTML pages. It describes what JavaScript can do, such as dynamically updating text and reacting to events. It also covers JavaScript syntax, variables, operators, functions, and objects. A significant portion of the document is devoted to explaining the DOM and how it allows JavaScript to access and modify HTML elements and structure programmatically.
HTML is a markup language used to define the structure and layout of web pages. CSS is used to style and lay out HTML elements, and JavaScript can be used to program behaviors and interactions in web pages. jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, animations, and Ajax interactions for rapid web development.
JavaScript is a scripting language used to make web pages interactive. It was created in 1995 and standardized as ECMAScript. JavaScript can access and modify the content, structure, and style of documents. It is used to handle events, perform animations, and interact with forms on web pages. Common uses of JavaScript include form validation, navigation menus, lightboxes, and sliders on websites.
Bootstrap is a free front-end framework for building responsive, mobile-first websites and web apps. It contains HTML and CSS-based design templates and components for things like typography, forms, buttons, navigation, and other interface components, as well as optional JavaScript extensions. Bootstrap features responsive grid system, tables, forms, buttons, navigation and other elements for developing responsive web pages and applications. It helps developers design websites faster without writing much custom CSS code.
The document provides an introduction to JavaScript, including its history and uses. It discusses how JavaScript is an interpreted programming language used for client-side scripting of web pages to make them dynamic and interactive. The document outlines key JavaScript concepts like variables, functions, operators, and conditional statements. It provides examples of how to write JavaScript programs and embed them in HTML files using the <script> tag.
React Native allows developers to build mobile apps using React with native platform capabilities. It uses native components instead of web views, making apps feel and perform like native ones. The document discusses what React Native is, how to set up a development environment, build a basic app, add libraries, handle common errors, and React Native fundamentals like components, styles, layout, events, and touch handling.
This document provides an overview of object-oriented concepts in JavaScript. It defines JavaScript and its components like ECMAScript, DOM, and BOM. It discusses how JavaScript supports object-oriented programming features like polymorphism and inheritance through prototypal inheritance despite not being a classical OOP language. The document also covers JavaScript data types, objects, scope, closures, context, and methods for changing contexts like call and apply.
Microsoft Typescript is a statically typed compiled language to clean and a simple plain old JavaScript code which runs on any browser, in Node.js or in any JavaScript engine that supports ECMAScript 3 (or newer).
Java is an object-oriented programming language created by James Gosling at Sun Microsystems in 1995. It is platform independent, meaning programs written in Java can run on any system that supports Java without needing to be recompiled. The document provides an overview of Java, including its history and development, basic concepts like classes and objects, and how to write simple Java programs. It also discusses Java's advantages like being simple, object-oriented, portable, multithreaded, and secure.
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
This document discusses the evolution of asynchronous programming on the .NET platform. It covers early approaches using Begin/End methods and event-based patterns in .NET 1.0. It then discusses improvements with yield in .NET 2.0/C# 2.0 and async workflows in F# for .NET 3.0. It also covers the Reactive Framework for .NET 4.0 which treats asynchronous computations as push-based collections. Finally, it discusses potential future improvements in C# vNext.
Beyond Breakpoints: A Tour of Dynamic AnalysisC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2dXUUTG.
Nathan Taylor provides an introduction to the dynamic analysis research space, suggesting integrating these techniques into various internal tools. Filmed at qconnewyork.com.
Nathan Taylor is a software developer currently employed at Fastly, where he works on making the Web faster through high performance content delivery. Previous gigs have included hacking on low-level systems software such as Java runtimes at Twitter and, prior to that, the Xen virtual machine monitor in grad school.
JavaScript basics
JavaScript event loop
Ajax and promises
DOM interaction
JavaScript object orientation
Web Workers
Useful Microframeworks
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
JavaScript basics
JavaScript event loop
Ajax and promises
DOM interaction
JavaScript object orientation
Web Workers
Useful Microframeworks
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2015.
http://www.ivanomalavolta.com
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...Codemotion
Front-end development has an amazing assortment of libraries and tools, yet it can seem very complex and doest seem much fun. So we'll live code a ClojureScript application (with a bit of help from Git) and show how development doesn't have to be complex or slow. Through live evaluation, we can build a reactive, functional application. Why not take a look at a well designed language that uses modern functional & reactive concepts for building Front-End apps. You are going to have to trans-pile anyway, so why not use a language, libraries and tooling that is bursting with fun to use.
JavaScript basics
JavaScript event loop
Ajax and promises
DOM interaction
JavaScript object orientation
Web Workers
Useful Microframeworks
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2016.
http://www.ivanomalavolta.com
This document provides an introduction to JavaScript including:
1. JavaScript is a client-side scripting language that adds interactivity to HTML pages. It is embedded directly into HTML and allows dynamic updating of content.
2. The document covers JavaScript syntax, variables, data types, functions, objects, arrays, strings, dates and more. It provides examples of how to declare variables, write functions, create objects and arrays, and manipulate strings and dates.
3. Methods for output, variable scope, and built-in objects like String, Array, Math and Date are described. The DOM (Document Object Model) and form validation using JavaScript are also mentioned.
This document provides an overview of JavaScript training topics including:
- Client-side programming fundamentals
- JavaScript syntax like variables, types, and arrays
- Object-oriented programming concepts like classes and methods
- Interacting with HTML and CSS
- Using development tools like Netbeans and Eclipse
- Advanced topics like scope, closures, prototypes, and JSON
This document provides an overview of the history and evolution of JavaScript. It discusses key dates and specifications including its first appearance in 1995 in Netscape Navigator 2.0 and the standardization process in the late 1990s. The document also covers JavaScript's core features like being dynamic, single-threaded, asynchronous and event-driven. It describes JavaScript's data types, objects, functions and common array methods. Overall, the document presents a comprehensive introduction to JavaScript from its origins to modern usage.
In JS: CLASS <=> Constructor FN
new FN() => FN() { this }
FN = CLASS (FN = FN, FN = DATA)
Objects
Prototype / __proto__
Inheritence
Rewriting / Augmenting
built in objects
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
This document contains information about Ricardo Silva's background and areas of expertise. It includes his degree in Computer Science from ISTEC and MSc in Computation and Medical Instrumentation from ISEP. It also notes that he works as a Software Developer at Shortcut, Lda and maintains a blog and email contact for Node.js topics. The document then covers several JavaScript, Node.js and Websockets topics through examples and explanations in 3 sentences or less each.
JavaScript is the programming language of the web. It can dynamically manipulate HTML content by changing element properties like innerHTML. Functions allow JavaScript code to run in response to events like button clicks or timeouts. JavaScript uses objects and prototypes to define reusable behaviors and properties for objects. It is an important language for web developers to learn alongside HTML and CSS.
This document provides an introduction and overview of the Java programming language. It discusses Java's history and key features such as being object-oriented, platform independent, and designed for robustness and security. It also covers Java variables, operators, decision-making structures like if/else statements, and loops like for and while.
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Erasmo Purificato
Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)
Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment.
How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.
How RPA Help in the Transportation and Logistics Industry.pptxSynapseIndia
Revolutionize your transportation processes with our cutting-edge RPA software. Automate repetitive tasks, reduce costs, and enhance efficiency in the logistics sector with our advanced solutions.
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Chris Swan
Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge.
You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter.
The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.
How Social Media Hackers Help You to See Your Wife's Message.pdfHackersList
In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.
Transcript: Details of description part II: Describing images in practice - T...BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 :
- Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants.
- REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.
The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.
Choose our Linux Web Hosting for a seamless and successful online presencerajancomputerfbd
Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently.
Visit- https://onliveserver.com/linux-web-hosting/
Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.
Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
2. Introduction
The World's Most Misunderstood Programming Language
- Has nothing to do with JAVA
- Object Oriented and Functional [Lisp in C’s clothing ]
- Designed as a scripting language for NetScape Navigator
- Traditionally abused for Form validation
- Now runs giants like walmart / paypal / linkedin
3. Introduction
JavaScript is a prototype-based
scripting language with dynamic typing
and first-class functions.
This makes it a mix of features makes it
a multi-paradigm language, supporting
object-oriented, imperative, and
functional programming styles.
Originally designed for the browser . But
now used literally everywhere.
4. History
- Created in 1995 by Brenden Eich
- First version was created in 10 days !
- Microsoft releases JScript for IE after few months
- Netscape goes to ECMA for getting standards
- First formal standards released in 1999 as ECMAScript 3- Has been
stable ever since
- Second coming happened after Google popularised concept of AJAX for
their web apps.
- Latest version (ES6) released last month with a lot of new features -
Classes , generators etc
- Google/Mozilla working on a project to make assembly in web possible.
(ASM.js / WebAssembly)
- Today its the most popular programming language on Github
5. Who uses JS?
In the Browser
Everyone who has a modern webpage/web app.
Best examples can be Google products.
And literally every website that you can think of.
Desktop
Windows 8 metro UI was built using it .
iOS uses a webkit engine for the great UI . Same
thing that is used by chrome for rendering.
6. Who uses JS?
Server Side
Walmart.com,Paypal,Linked in, Apple were early adopters.
Now most companies are moving to node / something
similar for their content serving
IOT - JS is becoming the go to language
RealTime - We are launching chat soon built fully in node
7. What can JS do today ?
- Run a VM inside a browser
- Run a game inside the browser
- Serve 300 million users without
shooting up the CPU
- Help in making PPTs online
- Make real time chat possible
Atwood's Law:
“any application that can be written in JavaScript, will
eventually be written in JavaScript.”
8. What can JS do ?
- Make cool graphics
- Make sophisticated dashboards
- Car dashboard panels
- and of course validation
10. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Numbers
- Double-precision 64-bit format [ Int and floats]
- Leads to problems this
0.1 + 0.2 == 0.30000000000000004
- All standard arithmetic operators ( + , - , * , / , % )
- Math Object , Math.sin() , Math.round() , Math.floor() etc
- parseInt() , parseFloat() for parsing string to numbers
- Special Numbers - NaN , Infinity
String
- Sequences of 16 bit Unicode chars . It will support any language . ह द , ಕನ ಡ
- String has a lot of built in functions, properties . DEMO
Boolean
- Coerce any thing into Boolean using Boolean()
- Falsy Values :false, 0, “”,NaN, null, and undefined
- Truthy Values: Everything else
11. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Declaring a variable
var a;
var b = 10;
b = “Hello World”
console.log(a) // Would show undefined - Means its declared but not defined
null
Is an assignment value.
Can be used for explicitly saying at a point of execution that variable is not available or
doesn't have an actual value.
null absence of value for a variable;
undefined absence of variable itself;
12. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Object
- Most important part of JS .Everything is an object in JS . Even Functions
- Simple collections of name-value pairs
- Primitives are immutable
var obj = new Object();
var obj = {};
function Person(name, age) {
this.name = name;
this.age = age;
}
var p1= new Person("John Doe", 24);
TIP: All object assignments are References . i.e when you do
var p2 = p1 // This will point to same place in memory
13. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Functions
- First class citizens
function add(x, y) {
var total = x + y;
return total;
}
This that you can do :
add(3,4) // will return 7
add(“hello”,”world”) // will return “helloworld”
add(3,4,5) // ??
add(3) // ??
add() // ??
All functions will have access to special parameters
inside its body like arguments , this etc.
var add = function(x, y) {
var total = x + y;
return total;
}
14. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Arrays [ ]
- Special type of Objects.
- Has a special property called length
- length is not the number of elements of array
- It is one more than highest index in the array
var arr = new Array();
arr[0] = 1; // Arrays dont have a type. You have have
arr[1] = ‘b’; // primitives or objects as array elements
arr[50] = new Object();
arr[99] = true;
console.log(arr.length) // Length would be 100 when actually there
// are only 4 elements in the array
15. Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Date
- Exact replica of Java date class.
- new Date() gives you the timestamp accurate to milliseconds from 1/1/1970
- new Date(10-1-2015) gives you a date object with that days timestamp
- Lots of date manipulation functions inbuilt. Also lots of good i18n functions
Regular Expressions
- One of the least exploited parts of JS.
- Good for form validation .
- Can be used along with String.replace method
16. Flow Control
Support for almost every flow control structure.
Including :
if then else
while
for
ternary operator
switch case
for in
break
continue
17. Error Handling
Best way to handle errors is to write good code.
Next best way is to use try catches
try {
Block of code to try
}
catch(err) {
Block of code to handle errors
}
This ensures that rest of the code continues to execute . Otherwise
your code will stop executing at the line where the error occurred .
Leading to total disaster.
19. Lets talk about the DOM
Document Object Model exposes many APIs to mess with its
Objects.
eg : getElementByID(“id”) , getElementsByClassName().
By using / misusing the APIs we can bring magic/disaster to web
pages.
DOM Manipulation
DOM Manipulation is slow. Depends based on the browser /OS/
System resources and implementation of DOM. After each
manipulation depending on what changes you made , browser has to
do a rerender / repaint.
Over to JSBin
20. Sync Vs Async
- Synchronous code runs line by line
- Async code runs parallely
- DEMO
21. Hoisting
Variable Hoisting
var declaredLater;
// Outputs: undefined
console.log(declaredLater);
declaredLater = "Now it's defined!";
// Outputs: "Now it's defined!"
console.log(declaredLater);
Function Hoisting
// Outputs: "Definition hoisted!"
definitionHoisted();
// TypeError: undefined is not a function
definitionNotHoisted();
function definitionHoisted() {
console.log("Definition hoisted!");
}
var definitionNotHoisted = function () {
console.log("Definition not hoisted!");
};
22. JSON
- Universal Data exchange format of web
- Invented initially for representing JS objects
- Supports all the basic data types
23. Scope
Scope is the set of variables you have access to.
In JS there are mainly two scopes
1) Local Scope
2) Global Scope
3) Automatic Global
Any variable declared inside a function using var has local
scope
Any variable declared outside it has global scope
Special Case : Any variable declared inside a function without
the “var“ keyword is assumed global and is assinged to global
scope.
function foo(){
var a =10; // Local scope
}
var b = 100; // Global scope
function bar(){
c = 10; // Automatic global
}
24. AJAX
AJAX - Asynchronous JavaScript and
XML.
Something that microsoft did right :P
AJAX is the art of exchanging data with a
server, and updating parts of a web page
- without reloading the whole page.
Implemented using the XMLHttpRequest
abstracted in jQuery using $.ajax({})
25. JS on the Server
Whats wrong with our servers ?
27. JS on the Server
Setting up a server using Node
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
28. JS on the Server
Setting up a server using Node