DYNAMIC WEB PAGES Dr Mohd Soperi Mohd Zahid Semester 2 2015/16.

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

What is jQuery Mobile? How to use it? Doncho Minkov Telerik Corporation Technical Trainer.
1 Web Site Design Overview of the Internet Cookie Setton.
CSCI 3100 Tutorial 6 Web Development Tools 1 Cuiyun GAO 1.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
JQuery A Javascript Library Hard things made eas(ier) Norman White.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
JQUERY/AJAX ALIREZA KHATAMIAN DELARAM YAZDANSEPAS.
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Chapter 1 Getting Started With Dreamweaver. Explore the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
ICS 665 Jesse Abdul. jQuery UI Overview  jQuery UI javascript library Includes all UI component functionality  jQuery UI CSS framework Includes standard.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
CST JavaScript Validating Form Data with JavaScript.
JQuery CS 268. What is jQuery? From their web site:
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
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.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
Session I Chapter 1 - Introduction to Web Development
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
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.
Web Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
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.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
CITA 330 Section 10 Web Remoting Techniques. Web Remoting Web Remoting is a term used to categorize the technique of using JavaScript to directly make.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
JQuery, JSON, AJAX. AJAX: Async JavaScript & XML In traditional Web coding, to get information from a database or a file on the server –make an HTML form.
AJAX. Objectives Understand and apply AJAX Using AJAX in DOJO library.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
National College of Science & Information Technology.
JavaScript and Ajax (Ajax Tutorial)
CSE 154 Lecture 11: AJAx.
Understanding XMLHttpRequest
Not a Language but a series of techniques
AJAX AJAX = Asynchronous JavaScript and XML.
Data Virtualization Tutorial… CORS and CIS
AJAX and REST.
Fundamentals, DOM, Events, AJAX, UI
AJAX.
CSE 154 Lecture 11: AJAx.
Bootstrap Components Reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more.
CSE 154 Lecture 22: AJAX.
JavaScript & jQuery AJAX.
Web Programming Language
MIS JavaScript and API Workshop (Part 3)
Introduction to AJAX and JSON
Introduction to AJAX and JSON
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

DYNAMIC WEB PAGES Dr Mohd Soperi Mohd Zahid Semester /16

jQuery UI Set of customizable JavaScript and CSS files that enable advanced visual and behavorial effects on web page Download from Grab the full download package (Leave the components in their default (checked) state, choose a theme (UI Lightness), and select Download Unzip the downloaded files and you will get three folders: css, development-bundle, and js. Place files in your document root or within your project

Activity 31 jQuery UI Test Page jQuery UI Test Page Here's some text!

Activity 31 cont. Bounce Drop Explode Fade Highlight Puff Pulsate Shake Slide Transfer

Cont. body { font-family: arial, helvetica, sans-serif; } #mainContainer { border: 3px solid black; padding: 10px; } #mainHeadingContainer { width: 300px; background: #999999; text-align: center; } #header { width: 300px; height: 200px; background: #CCCCCC; margin-bottom: 25px; }.transfer { border: 2px solid black; }

Cont. $(document).ready(function() { $("form").on('submit', function() { var effect = $(":input[name=effect]").val(); var options = {}; var effectTime = 1000; if (effect === "transfer") { options = {to: "#trash", className: "transfer"}; effectTime = 500; } $("#header").effect(effect, options, effectTime); return false; }); $(":input[name=reset]").on('click', function() { $("#header").removeAttr("style"); });

Creating a Calendar jQuery UI Datepicker

cont. Call.js $(document).ready(function() { $('#cal').datepicker(); }); Cal.css #mainContainer { border: 3px solid black; padding: 10px; }

Customizing Calendar jQuery UI Datepicker $(document).ready(function() { $('#cal').datepicker({ showButtonPanel: true, numberofMonths: 2, changeMonth: true, changeYear: true });

Using Dialog box jQuery UI Datepicker Click here to open the dialog Here's a dialog

Cont. $(document).ready(function() { $('#dialog').dialog({ autoOpen: false, resizable: false, modal: true, buttons: { "Confirm": function() { $(this).dialog('close'); }, "Cancel": function() { $(this).dialog('close'); } }); $("#opener").on('click', function() { $('#dialog').dialog('open'); });

Autocomplete 1 jQuery UI Autocomplete functionality $(function() { var availableTutorials = [ "ActionScript", "Boostrap", "C", "C++", ]; $( "#automplete-1" ).autocomplete({ source: availableTutorials }); Type "a" or "s" Tags:

Autocomplete 2 jQuery UI Autocomplete functionality $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL","ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp","Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"]; $( "#tags" ).autocomplete({ source: availableTags }); Tags:

jQuery Mobile Helps to make sites work well in a mobile environment, although it is not the only option Takes care of the layout and the transition between pages of a site to make the site more like a mobile app Available as a download or through a Content Delivery Network (CDN) Download from get the latest stable versionhttp://jquerymobile.com

Activity 35 (Basic) Test Page for jQuery Mobile Test Page This is some nice content. Footer content

Page link in jQueryMobile Links to pages in current site use AJAX by default. We could set it not to use AJAX Links to something outside current site do not use AJAX We will study AJAX later, but when it is used, an animation will be displayed before the linked page is loaded. The animation serves as transition to make the current page out of view Types of transition available: fade (default), flip, flow, none, pop, turn, slide, slidedown, slideup, slidefade

Linking without AJAX Links outside the site (to another domain) Links defined with rel=“external” attribute Links defined with the data-ajax=“false” attribute Links defined with a target attribute

Activity 36 (Ways of Loading links) Test Page for jQuery Mobile Link Page Load the test page (default behavior) Load test page (with turn transition effect) Load the test page (data-ajax = false) Load the test page (rel = external) Load the test page (in new tab) jQueryMobile page

Activity 37 (Navigation bar & buttons) Adding Navigation Tool bars Go Back My Buttons Go Forward Assalamualaykum/ Salam Sejahtera! Line 2 Line 3 Sweet Home Have a nice time!

AJAX Before this, we have been focusing on changing the behaviors, look and feel of pages, and little validation of forms Asynchronous JavaScript and XML (AJAX) JavaScript feature to allow pages to obtain and work with data to and from the server Examples of data are such as flight times, prices, etc. Three (3) primary components in a web application: Display, Behavior, and Data JavaScript interact with a database or server through AJAX or web services

AJAX Basics AJX-based applications send request from the web browser to the web server in the background (asynchronously) to make the pages more responsive to the user The actual process of sending a request and handling the response involves the fundamental AJAX object called, XMLHttpRequest jQuery includes a built-in function called $.ajax() to simplify the process of sending and receiving data XML contains extraneous information JSON (JacaScript Object Notation) provides a lightweight way to exchange data over AJAX - without X!

AJAX Architecture

XML vs JSON Mohd Soperi Mohd “person”: { “firstname” : “Mohd Soperi”, “lastname” : “Mohd Zahid”, “ Address” : { “primary ” : }, “twitter” : } XML version JSON version – represented in less extraneous information, but clarity is still maintained

Using AJAX Instantiate XMLHttpRequest object Build a request by specifying the request method (GET, POST, HEAD, etc), the URL to which request will be sent, and a true/false value indicating whether the request will asynchronous or synchronous Send requests to the web server synchronously or synchronously For asynchronous, check response status using onreadystatechange event to trigger code that checks the event’s readyState property (values given in next slide) AJAX response received (status value 200 = success) Process AJAX response

Synchronous Web interaction

Asynchronous Web interaction

readyState property values ValueDescription 0Uninitialized. Open but has yet to be called 1Open. Initialized but not yet sent 2Sent. The request has been sent 3Receiving. The HTTP response headers have been received, but the response body has not yet been completely received 4Loaded has been fully received

Activity 38 (A Simple AJAX program) Let AJAX change this text Change Content function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById("demo").innerHTML = xhttp.responseText; } xhttp.open("GET", "ajax_info.txt", true); xhttp.send(); }

Getting XML data Retrieve data from XML file Status: Status text: Response: Get XML data function loadDoc(url) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById('A1').innerHTML = xhttp.status; document.getElementById('A2').innerHTML = xhttp.statusText; document.getElementById('A3').innerHTML = xhttp.responseText; } xhttp.open("GET", url, true); xhttp.send(); }

AJAX and jQuery jQuery offers several functions for working data such as.load(),.post(), and.getJSON() The.ajax() function can be used to set several parameters such as HTTP method, time-out, what to do when an error occurs, etc.

Activity 40 AJAX, jQuery and JSON Test $(document).ready(function() { $("#driver").click(function(event){ $.getJSON('test.json', function(jd) { $('#stage').html(' Name: ' + jd.name + ' '); $('#stage').append(' Age : ' + jd.age+ ' '); $('#stage').append(' Sex: ' + jd.sex+ ' '); }); Click on the button to load data from json file: STAGE