Javascript and Dynamic Web Pages: Client Side Processing

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 11: Advanced Web Technologies.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Lecture 3B: Client-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
Multiple Tiers in Action
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Inline, Internal, and External FIle
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Web engineering. Topic: DHTML Presented by: Shah Rukh Presented to: Sir Ahsan raza.
Mobile App Support Jacob Poirier Geri Hengesbach Andrea Menke Erin Rossell.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Working with Objects Creating a Dynamic Web Page.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Asstt. Prof Sonia Sharma Computer Dept 1 HTML ( Hypertext MarkUP Language ) HTML is the lingua franca for publishing hypertext on the World Wide Web.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript & Introduction to AJAX
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Servlets What is a Servlet?
DHTML.
Build in Objects In JavaScript, almost "everything" is an object.
Tonga Institute of Higher Education IT 141: Information Systems
Web Technologies Computing Science Thompson Rivers University
Programming Web Pages with JavaScript
Unit M Programming Web Pages with
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
Using JavaScript to Show an Alert
Chapter 5 Scripting Language
Lecture 11. Web Standards Continued
JavaScript Event Handling.
Unit M Programming Web Pages with
W3C Web standards and Recommendations
Intro to JavaScript CS 1150 Spring 2017.
Section 17.1 Section 17.2 Add an audio file using HTML
Web UI Basics ITM 352.
Chapter 5 Scripting Language
Introduction to JavaScript
DHTML Javascript Internet Technology.
A second look at JavaScript
Your 1st Programming Assignment
Chapter 27 WWW and HTTP.
Tonga Institute of Higher Education IT 141: Information Systems
DHTML Javascript Internet Technology.
Secure Web Programming
Tonga Institute of Higher Education IT 141: Information Systems
Javascript and JQuery SRM DSC.
Introduction to JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
An Introduction to JavaScript
Web Technologies Computing Science Thompson Rivers University
JavaScript.
Creating dynamic/interactive web pages
Web Programming and Design
Introduction to Web programming
Web Application Development Using PHP
Presentation transcript:

Javascript and Dynamic Web Pages: Client Side Processing ITM352 Javascript and Dynamic Web Pages: Client Side Processing

DHTML Dynamic HTML, or DHTML, is an umbrella term for a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model.

Dynamic Web Pages Basic web pages are “static” They are set in advance, not created or modified at request time Dynamic web pages are processed (at least partially) at request time by scripting code to create the output Allows changes at request time There are two opportunities for this (1) on the server after request (2) on the client after the file received Though a “gateway” (CGI) or internal to Browser (API, plugin, etc.) There are many scripting languages PHP is most popular for sever side  processes web page file before browser gets it JavaScript for client side  processes web page file after browser gets it (2) (1)

DOM The Document Object Model (DOM) is the way things in markup (HTML, XML, etc.) documents are represented within a (standards compliant) browser Objects are organized in a tree Logically and for a page Let’s use Chrome tools to look Internal scripting languages such as JavaScript can access and manipulate the DOM

Javascript, HTML, DOM A Javascript “object” is a data structure that is a collection of properties, and a property is an association between a name (or key) and a value. A property's value can be a function, in which case the property is known as a method. An HTML tag is is also a kind of ”object” on a page that has data (usually the stuff between the open/close tags) and attributes which are properties of the HTML element The DOM has a Javascript object representation that is a standard for getting, changing, adding, or deleting HTML elements on a page Access an object through its references to use its properties.methods using the dot “.” <p id="demo">Hello World!</p> console.log( document.getElementById("demo").innerHTML ) You can find the properties and methods for DOM objects in a reference such as http://www.w3schools.com/jsref/ Tip: Netbeans and Chrome developer tools will show available properties/methods when you try to access an object

Using Javascript You can use Javascript Between <script></script> <script>alert("Hello!")</script> As values for an HTML element event attribute <input type="button" value="Press Me" onclick="alert('Hello!');> **TIP** You can use different quotes to separate HTML and Javascript quotes <input type="button" value="Press Me" onclick="alert(this.value + ' says hello!');"> **TIP** The keyword “this” in Javascript will always reference the HTML element you are in In the developer tools console inside a browser alert('Hello!'); Remember Javascript is run by the client e.g. a browser You have no control on if the Javascript will actually execute e.g. user denies scripts You do not know what version of Javascript is available. Different browsers may have different versions or may run the script differently You cannot access much of anything outside the users browser e.g. you cannot load files from a users directory