JavaScript Introduction inf385t Semantic Web 2/20/2006.

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

Java Script Session1 INTRODUCTION.
Introduction to JavaScript
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Languages for Dynamic Web Documents
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
1 Owais Mohammad Haq Department of Computer Science Eastern Michigan University April, 2005 Java Script.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
Lecture 3B: Client-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
HTML Recall that HTML is static in that it describes how a page is to be displayed, but it doesn’t provide for interaction or animation. A page created.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 8: JavaScript I.
Multiple Tiers in Action
Guide To UNIX Using Linux Third Edition
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
JavaScript Demo Presented by … Jaisingh Sumit jain Sudhindra Taran Deep arora.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
JAVASCRIPT HOW TO PROGRAM -2 DR. JOHN P. ABRAHAM UTPA.
Javascript and the Web Whys and Hows of Javascript.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
4.1 JavaScript Introduction
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
DOM and JavaScript Aryo Pinandito.
CISC474 - JavaScript 03/02/2011. Some Background… Great JavaScript Guides: –
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.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
JavaScript. Overview Introduction: JavaScript basics Expressions and types Expressions and types Arrays Arrays Objects and Associative Arrays Objects.
An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
JavaScript - A Web Script Language Fred Durao
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
An Introduction to JavaScript By: John Coliton Tuesday, November 10, 1998 Center for Teaching and Learning.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora
1 Javascript CS , Spring What is Javascript ? Browser scripting language  Dynamic page creation  Interactive  Embedded into HTML pages.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript & Introduction to AJAX
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Javascript and Dynamic Web Pages: Client Side Processing
Applied Component I Unit II Introduction of java-script
“Under the hood”: Angry Birds Maze
Donna J. Kain, Clarkson University
Barb Ericson Georgia Institute of Technology May 2006
JavaScript an introduction.
“Under the hood”: Angry Birds Maze
JavaScript.
Introduction to JavaScript
Presentation transcript:

JavaScript Introduction inf385t Semantic Web 2/20/2006

What is Javascript? Scripted Programming Language Cannot run standalone. Embedded is most web browsers. Often used to create web pages that respond dynamically to user action. Also used for server side development.

History Need for client side interaction. First developed by Netscape. Later purchased by Sun. Not related to the Java Programming Language. Not quite the same as Microsoft’s JScript.

Document Object Model A framework to describe a web page (document) in a tree-like structure. Specs:

Application Programming Interface The DOM is accessed through the API. The official client-side API documentation is here:

Getting Started Usually goes between and tags. Code is also put inside HTML comments Web Page <!-- html comment // code goes here // -->

Variables <!-- html comment var x = 15; var _y = x * 10; var name = prompt("What is your name?"); // -->

Modifying a document <!-- html comment document.write("<a href=\""); document.write(document.referrer); document.write("\">Return to the last page "); // -->

Formatting Strings Strings have methods that modify the way they are printed. <!-- html comment var name = prompt("What is your name? "); document.writeln(name.fontcolor("red")); document.writeln(name.italics()); document.writeln(name.toUpperCase()); // -->

Functions <!-- html comment function foo(name) { document.writeln(name.bold()); } // -->

More Programming Constructs if if(var1==var2) {/* do stuff */ } for loops for(i=0; i < count; i++) {/* do stuff */ } while loops while(var1==var2) {/* do stuff */ } arrays var a = new Array(1, 2, 3); document.writeln (a[0]);

Interaction Link and image elements have special properties that use the definitions set up in the main block. Click me change

Forms <input type="text" name="name" size="40" value="Enter your name" onFocus="foo();" onChange="foo();" > document.form1.name.value = "John"; document.form1.name.focus();

Sorting a Table

Learning from Others Client-side Javascript can be viewed by looking at the source code for a page. Consider this function from the Google homepage. <!-- function qs(el) { if (window.RegExp && window.encodeURIComponent) { var ue=el.href; var qe=encodeURIComponent(document.f.q.value); if(ue.indexOf("q=")!=-1) { el.href=ue.replace(new RegExp("q=[^&$]*"),"q="+qe); } else { el.href=ue+"&q="+qe; } } return 1; } // -->

Applications Shadows Bookmarklet – Google Maps – Gmail – Flickr – Del.icio.us – Tecnorati – Digg –