Lect2 (MCS/BCS) Javascript.

Slides:



Advertisements
Similar presentations
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
Advertisements

JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Inline, Internal, and External FIle
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
CSC317 – INTERNET PROGRAMMING CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: MUHD EIZAN SHAFIQ BIN ABD AZIZ FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
Lectured By: Vivek Dimri Asst. Professor, SET, Sharda University
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Internet Mark-up Languages CO32036 Part Lecture: Elementary JavaScript.
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.
JavaScript Introduction
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
Week 9 PHP Cookies and Session Introduction to JavaScript.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
JavaScript Introduction 1. What is Java Script ? JavaScript is a client-side scripting language. A scripting language is a lightweight programming language.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
1 JavaScript
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
HTML JAVASCRIPT. CONTENTS Javascript Example NOSCRIPT Tag Advantages Summary Exercise.
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Chapter 5: Intro to Scripting CIS 275—Web Application Development for Business I.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Tarik Booker CS 120 California State University, Los Angeles.
CGS 3066: Web Programming and Design Spring 2017
Build in Objects In JavaScript, almost "everything" is an object.
Java Script Introduction. Java Script Introduction.
JavaScript Tutorial Second lecture 22/2/2016.
CHAPTER 4 CLIENT SIDE SCRIPTING PART 1 OF 3
Pertemuan 7 JavaScript.
>> JavaScript: Location, Functions and Objects
JavaScript Wrap-up.
JavaScript is a programming language designed for Web pages.
JavaScript - Errors & Exceptions Handling
JavaScript Loops.
Exploring JavaScript Ch 14
My First Web Page document.write("" + Date() + ""); To insert.
WEB APPLICATION PROGRAMMING
Javascript Short Introduction By Thanawat Varintree,
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Introduction to JavaScript
JavaScript Introduction
DHTML Javascript Internet Technology.
Your 1st Programming Assignment
Introduction to JavaScript
JavaScript – Part I Mendelsohn.
DHTML Javascript Internet Technology.
The Web Wizard’s Guide To JavaScript
T. Jumana Abu Shmais – AOU - Riyadh
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
The <script> Tag
Software Engineering for Internet Applications
Web Programming– UFCFB Lecture 13
JavaScript and Ajax (JavaScript Events)
Introduction to JavaScript
Web Programming and Design
Web Programming and Design
CS105 Introduction to Computer Concepts JavaScript
Presentation transcript:

Lect2 (MCS/BCS) Javascript

HTML & JavaScript Code: <html> <body> <script type="text/JavaScript"> document.write("Hello World!") </script> </body> </html> script use a function called document.write, which writes a string into our HTML document.

File myjs.js Contents: function popup() { alert("Hello World") }

HTML & JavaScript Code: <html> <head> <script src="myjs.js"> </script> </head> <body> <input type="button" onclick="popup()" value="Click Me!"> </body> </html>

javascript arithmetic operator chart Addition Subtraction Multiplication Division Reminder

javascript operator example with variables <body> <script type="text/JavaScript"> var two = 2 var ten = 10 var linebreak = "<br />" document.write("two plus ten = ") var result = two + ten document.write(result) document.write(linebreak) document.write("ten * ten = ") result = ten * ten document.write("ten / two = ") result = ten / two </script> </body>

comparison operators == < > <= >= etc

javascript using variables A variable's purpose is to store information so that it can be used later. A variable is a symbolic name that represents some data that you set.

HTML & JavaScript Code: <body> <script > var linebreak = "<br />" var my_var = "Hello World!" document.write(my_var) document.write(linebreak) my_var = "I am learning JavaScript!" my_var = "Script is Finishing up..." </script> </body>

Output Hello World! I am learning JavaScript! Script is Finishing up...

what's a function? A function is a piece of code that sits hidden until it is referenced or called upon to do its "function". In addition to controllable execution, functions are also a great time saver for doing repetitive tasks.

example function in javascript A function that does not execute when a page loads should be placed inside the head of your HTML document. Creating a function is really quite easy. All you have to do is tell the browser you're making a function, give the function a name, and then write the JavaScript like normal. Example

HTML & JavaScript Code: <html> <head> <script type="text/javascript"> function popup() { alert("Hello World") } </script> </head> <body> <input type="button" onclick="popup()" value="popup"> </body> </html>

events in javascript <html> <head> <script type="text/javascript"> <!-- function popup() { alert("Hello World") } //--> </script> </head> <body> <input type="button" value="Click Me!" onclick="popup()"><br /> <a href="#" onmouseover="" onMouseout="popup()"> Hover Me!</a> </body> </html>