Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.

Slides:



Advertisements
Similar presentations
© 2002 D & D Enterprises 1 Linking Images For Navigation & Clickable Image Maps.
Advertisements

JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Molecular Biomedical Informatics Social Web Design & Research & Social Web Design & Research 1.
Overview Environment for Internet database connectivity
Web Programming 1 Darby Chang Web Programming. Cookie 2 Web Programming.
Social Web Design 1 Darby Chang Social Web Design.
Molecular Biomedical Informatics Web Programming 1.
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Fawaz Ghali AJAX: Web Programming's Toy.
Essentials for Design JavaScript Level One Michael Brooks
Lecture 12: Web Services MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET Objectives “Web Services are objects callable across a network.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
CIS 4004: Web Based Information Technology Spring 2013
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Social Web Design 社群網站設計 1 Darby Chang 張天豪 Social Web Design 社群網站設計.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
6/3/2015eBiquity1 Tutorial on AJAX Anubhav Kale (akale1 AT cs DOT umbc DOT edu)
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Social Web Design & Research 社群網站設計 & 研究 Social Web Design & Research 1.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Social Web Design 社群網站設計 1 Darby Chang 張天豪 Social Web Design 社群網站設計.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Social Web Design & Research 社群網站設計 & 研究 Social Web Design & Research 1.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Introduction to AJAX AJAX Keywords: JavaScript and XML
JavaScript & jQuery the missing manual Chapter 11
1 Ajax. 2 What’s Ajax? AJAX is a combination of a few technologies that has come together in the past few years AJAX used to be an acronym for Asynchronous.
Ruth Betcher Ruth Christie
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
AJAX and Atlas in ASP.NET 2.0 William J. Steele MSDN Developer Evangelist Microsoft Corporation
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Instructor, Dr. Khalili Bahram Jeevan Kumar Gogineni.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
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.
the acronym for Asynchronous JavaScript and XML.
Ajax for Dynamic Web Development Gregory McChesney.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
JQuery and AJAX WEB Technologies : PHP Programming Language.
Event Handling & AJAX IT210 Web Systems. Question How do we enable users to dynamically interact with a website? Answer: Use mouse and keyboard to trigger.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
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?
Javascript and Dynamic Web Pages: Client Side Processing
JavaScript and Ajax (Ajax Tutorial)
Not a Language but a series of techniques
AJAX.
AJAX.
AJAX Robin Burke ECT 360.
JQuery with ASP.NET.
MIS JavaScript and API Workshop (Part 3)
Chengyu Sun California State University, Los Angeles
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:

Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1

Ajax 2 Asynchronous JAvascript XML 非同步的 JavaScript 與 XML 技術 Web Programming 網際網路程式設計

Ajax Ajax is a combination of multiple existing technologies –use HTML+CSS for expression –use JavaScript to operate DOM objects for dynamic effects –use XML for data exchange –use XMLHttpRequest for asynchronous connection with web server –use JavaScript to bind them all Ajax does not refer to a single technology but to organically using a series of related technologies Web Programming 網際網路程式設計 3

XML eXtensible Markup Language Content-type: text/xml\n\n Web Programming 網際網路程式設計 4

A traditional web app Web Programming 網際網路程式設計 5 Tell users to fill HTML forms and to request the server for each form. The server receives and processes the requested form and response the result page.

Innovation from existing technologies The above process wastes much bandwidth, since usually the result page is very similar to the request page. Namely, most HTML code are the same in the two pages. –in short, only very tiny part need to update We have such technologies for a long time. For example, we have already used JavaScript to update partial page (such as a marquee) or used XML to transfer data (but not in web page) –actually, if someone thought to use JavaScript to update web page according to the transferred data, he got Ajax  the importance of idea Web Programming 網際網路程式設計 6

Ajax Web Programming 網際網路程式設計 7 Update a little 只改一點點

Killer applications Traditional web mails – Modern web mails – –Ajax requires JavaScript, thus some kind web sites would provide a non-Ajax version that does not depend on JavaScript – 浅谈 Gmail 邮箱发展历史 浅谈 Gmail 邮箱发展历史 – 回顾 Gmail 历史 —— 猛击网页邮箱的 G 点! 回顾 Gmail 历史 —— 猛击网页邮箱的 G 点! BTW, Ajax is regarded invented in 1998 by the Outlook Web Access team of Microsoft  the importance of idea –AJAX - 维基百科AJAX - 维基百科 Web Programming 網際網路程式設計 8

Other Google applications Google Google Calendar Google Docs Google Maps The so-called rich interface application (RIA). Since each time only a tiny part is updated, the content could be very complicated. The entire page wouldn’t be reloaded. –some are too rich to provide a non-Ajax version Web Programming 網際網路程式設計 9

Common Ajax-dependent components Auto complete ( 自動完成 ) –Ajax Autocomplete for jQueryAjax Autocomplete for jQuery –FCBKcompleteFCBKcomplete –ajax autocomplete - Google 搜尋ajax autocomplete - Google 搜尋 Tooltip ( 工具提示 ) –40+ Tooltips Scripts With AJAX, JavaScript & CSS40+ Tooltips Scripts With AJAX, JavaScript & CSS –tooltip - Google 搜尋tooltip - Google 搜尋 Upload ( 上傳 ) – –upload - Google 搜尋upload - Google 搜尋 Human is slow. Leak a partial content for the users to read (or let them to input something) first. The response time of human is very enough for machines to do the actual work. Don’t waste such time. Web Programming 網際網路程式設計 10

A simple Ajax example Design logic –users fill a HTML form and submit it –after submitting, the client does not wait the response of the server and the control returns to the users immediately  this behavior is the so-called asynchronous ( 非同步 ) –change the content to ‘loading’, which makes the users comfortable –after receiving the server response, display the results Web Programming 網際網路程式設計 11

The HTML Go initial content Web Programming 網際網路程式設計 12 The design of HTML form should follow the conventions of the non-Ajax version, in case that you need a non-Ajax one Usually you need to set the id attribute of the DOM objects for manipulating them easily

The JavaScript jQuery(document).ready(function(){ jQuery('button[type=submit]').click(function(){ jQuery.ajax({ data: { id: jQuery('input[name=id]').val() }, url: 'do', success: function(data){ // (A) jQuery('#content').text(data); } }); jQuery('#content').html('loading...'); // (B) }); }); Web Programming 網際網路程式設計 13 The handler after that the document is ready (‘ready’ event) An event to activate the Ajax. Here the handler after clicking the button (‘click’ event) is used Invoke the Ajax. There are many Ajax functions in jQuery such as get(), getJSON(), getScrtip()... See Pack the data, yes, by ourselves. Here the data is still got from with name attribute, just as the non-Ajax version. But there might be manipulations. The CGI URL, which knows nothing about whether this is an Ajax call. The handler after server responds. The response is no longer processed by the browser. Instead, it becomes a variable ( data here) and should be processed by JavaScript, namely by ourselves. Update accordingly. Here #content is used to display the results and the response is used as plain text. It can be used as HTML with.html() or more complex structures. The handshaking is now our business. Asynchronous is here! If you know how the code of (A) and (B) are executed, you understand Ajax. After ajax(), two asynchronous program flows appear. Make users comfortable. Here a loading message is displayed in #content. It could be more beautiful, see and

Notes Follow the conventions of the non-Ajax version Usually you need a DOM object to for output An event to activate the Ajax Invoke the Ajax –pack the data (by ourselves, there might be manipulations) – After Ajax, you got two asynchronous program flows –after submitting, display messages to make users comfortable –after server response, display the results by ourselves Web Programming 網際網路程式設計 14

Any Questions? Web Programming 網際網路程式設計 15 about Ajax

Today’s assignment 今天的任務 Web Programming 網際網路程式設計 16

Make your site more fluent Make your existing CGI functions to the Ajax version so that no page reload after users’ requests. If appropriate messages are provided, users would feel that all operations are immediate. Reference –Ajax – jQuery APIAjax – jQuery API –Ajaxload - Ajax loading gif generatorAjaxload - Ajax loading gif generator –Preloaders.net - AJAX loading GIF and APNG spinners, bars and 3D animations generatorPreloaders.net - AJAX loading GIF and APNG spinners, bars and 3D animations generator –5 Ways to Make Ajax Calls with jQuery5 Ways to Make Ajax Calls with jQuery Your web site ( ex5) will be checked not before 23:59 11/6 (Tue). You may send a report (such as some important modifications) to me in case I did not notice your features. Web Programming 網際網路程式設計 17