1.NET Web Forms Client-Side JavaScript © 2002 by Jerry Post.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Bring Life to Your Web Pages with JavaScript and HTML5 Ole Ildsgaard Hougaard -
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
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.
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Computer Science 103 Chapter 4 Advanced JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
CST JavaScript Validating Form Data with 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.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript & jQuery the missing manual Chapter 11
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Chapter 19: Adding JavaScript
JavaScript II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
Working with Objects Creating a Dynamic Web Page.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
CSC 551: Web Programming Fall 2001 emerging & alternate Web technologies  Dynamic HTML  ActiveX  XML course overview  online review sheet  advice.
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.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Interactive Client-Side Technologies MMIS 656 Web Design Technologies Acknowledgements: Estrella, S. (2003). The Web Wizard’s Guide to DHTML and CSS.
DHTML: Working with Objects Creating a Dynamic Web Page.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
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;
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
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
JavaScript II ECT 270 Robin Burke. Outline Functions Events and event handling Form validation.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
JAVASCRIPT A quick review. True False ■The DOM is a standardized way of referring to parts of a Web page. ■TRUE ■In the DOM, attributes have their own.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.
Third lecture Event 27/2/2016 JavaScript Tutorial.
Using DHTML to Enhance Web Pages
Web Development & Design Foundations with HTML5
JavaScript Event Handling.
Microsoft® Office FrontPage® 2003 Training
Web Development & Design Foundations with HTML5 7th Edition
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
Web Design and Development
Presentation transcript:

1.NET Web Forms Client-Side JavaScript © 2002 by Jerry Post

2 Syntax: C variant  Netscape  Microsoft Web Development + HTML and Dynamic HTML + SDK Documentation + Reference  Variables:var i; (does not support data types)  Conditionsif (i > 10) { … }  Loopswhile (condition) { … }  Functionsfunction myFn(a, b, c) { … }  No pointers!  alert(“Message”) helps with debugging  WARNING: Everything in Javascript is case-sensitive!!!!

3 Document Object Model (DOM)  Anything you really want to do in client JavaScript relies on the document object model.  The “old” Netscape DOM has nothing in common with  The “standard” Microsoft DOM  Which is good, since the Netscape version was awful.  Two primary elements to learn  Reference to objects on the page (especially in forms)  Events

4 Document/Form Items  Refer to a value: document.form1.UserID.value  Submit a form with a button (rare): onClick=“this.form.submit()”

5 Form Validation  Today, build it into ASP.NET and let it write the code.  But, in case you need more detailed code: Function ValidateMe() { // a bunch of if tests on document.form1.whatever if (valid) { return true; } else { return false; }

6 Events  Many objects on the page support events. Common list:  click  focus  onmouseover  Onmouseout  Easiest structure is to define functions to handle each desired event, and then add the appropriate call to the object: 

7 Setting focus  A common script task is the ability to set focus to the initial text element. Strangely, ASP.NET does not yet support this feature.  Put the script at the end of the document, and double-check that control exists before you set focus (to ensure the form is loaded). if(document.Form1.txtUser != null) document.Form1.txtUser.focus();

8 Rollover Effects  Commonly used with buttons. You can add the code to an asp button, or to an HTML button. It will only work with Microsoft Internet Explorer. <asp:ImageButton id="ImageButton1" style="Z-INDEX: 119; LEFT: 202px; POSITION: absolute; TOP: 504px“ runat="server" ImageUrl="images/DeleteButton1.gif“ onmouseover="this.src='images/DeleteButton2.gif';“ onmouseout="this.src='images/DeleteButton1.gif';">

9 Drop-Down Menus  These require relatively complex code.  The code is really ugly if you want to support Netscape as well as Microsoft.  Several versions can be found on the Internet. Only a few support Netscape.  Microsoft documentation (MSDN) a couple of years ago had a nice system that uses XML and XSL to set the menu items. Style was controlled through style sheets, so the system was easy to implement.  ASP.NET does support a tree-structure control, but it probably requires a round-trip for each click.  It would take a dedicated class in JavaScript to cover all of the details to write your own.