CS50 Week 9 Sam Green ’17 646-457-2340.

Slides:



Advertisements
Similar presentations
JavaScript – Quiz #8 Lecture Code:
Advertisements

1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
JavaScript and AJAX Jonathan Foss University of Warwick
AJAX – The Future of Web Development? Anders Moberg David Mörtsell David Södermark.
1 Javascrbipt Intro Javascript (or js) is a programming language. Interpreted, not compiled. Not the same as java, but, similar. Use tags to use. Object-oriented.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Web Usability Using JavaScript An Introduction to JavaScript Universidade Federal do Rio de Janeiro Departamento de Eletrônica e Computação Programação.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
The PHP Story. PHP Story PHP is a programming language. Incorporate(join) sophisticated business logic. Widely used general purpose scripting language.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Chris Pinski.  History  What is Ajax  Who uses Ajax  Underlying Technologies  SE Aspect  Common Problems  Conclusion.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
JavaScript JavaScript is a scripting language that is most commonly used to add client- side programming to a web page. Some of the things it is used for.
Intro to JavaScript Events. JavaScript Events Events in JavaScript let a web page react to some type of input Many different ways to handle events due.
Writing various AJAX forms in Drupal 7 1. Overview of Form API 2. Ctools 2.1 Ctools features 3. Ajax 3.1 Ajax Forms in Drupal 4. Putting it all together.
JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.
DOM and JavaScript Aryo Pinandito.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
JavaScript – Quiz #9 Lecture Code:
JavaScript Frameworks Presented by Kyle Goins Also see:
Dynamic Pages – Quiz #11 Feedback (under assignments) Lecture Code:
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
JavaScript Syntax, how to use it in a HTML document
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Web Design: Basic to Advanced Techniques Fall 2010 Mondays 7-9pm 200 Sutardja-Dai Hall Introduction to PHP.
1 CSC 301 Web Programming Charles Frank. PHP – Stands for:  Personal Home Page (originally),  PHP: Hypertext Preprocessor (now; follows GNU’s recursive.
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
Quiz 1 Review (Week 10) Sam Green ’17 (646)
JQuery and AJAX WEB Technologies : PHP Programming Language.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Event Handling & AJAX IT210 Web Systems. Question How do we enable users to dynamically interact with a website? Answer: Use mouse and keyboard to trigger.
JavaScript Dynamic Active Web Pages Client Side Scripting.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
JavaScript & Introduction to AJAX
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Javascript AJAX HTML WEB SERVER Asynchronous. Javascript HTML events DOM – document object model browser internal view of html page compute.
Quick look under the hood Technologies used Get familiar with them! By Michał Kostecki IITc.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Dive into web development
Programming Web Pages with JavaScript
CSC 301 Web Programming Charles Frank.
CS 371 Web Application Programming
Lecture 11. Web Standards Continued
AJAX and REST.
Application with Cross-Platform GUI
AJAX.
Introduction to JavaScript
Web Systems & Technologies
JavaScript Introduction
JavaScript an introduction.
DWR: Direct Web Remoting
A second look at JavaScript
Introduction to JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
Client-Server Model: Requesting a Web Page
Class 4: Building Interactive Web Pages
Creating dynamic/interactive web pages
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

CS50 Week 9 Sam Green ’

Today’s Agenda JavaScript: Basics & Use Cases DOM – Document Object Model Practice with JS and the DOM A Toy API Example PSet

What is JavaScript? Client-side dynamic programming language Speed and easy of use from client side language. JS doesn’t fit into one category of programming Has elements of functional, object-oriented, and imperative programming Interpreted, not compiled (like PHP) Can manipulate the DOM to change HTML – one of the reasons it is so popular.

Functions as Values Functions in JavaScript are values. They can be assigned to variables. They can be passed as arguments or returned as results from other function calls.

Anonymous Functions var f = function(){ alert(“Sam!!!!”); }; f();

Objects & Functions as Values An object is a container for related values. Some of these values can be functions (!). Example: JS onsubmit function from lecture. Example: JS onclick

Document Object Model (DOM) Hierarchical way of laying out information HTML webpage is an example. Let’s draw a DOM tree for Hey Sam

JS and the DOM JS allows us to dynamically alter the DOM, without reloading the page. Key point on this: we can use JS to select elements from the DOM and then change them.

JS Validation What are the benefits of client-side form validation? What can we validate? Is the PHP back-end still necessary?

Let’s do some DOM manipulation examples.

Ajax and Asynchronous Requests Ajax is an JavaScript paradigm for asynchronous web requests. Ajax is let’s webapps be powerful. Example in life: when new tweets appear on your Twitter feed, that happens via Ajax.