Introduction to jQuery

Slides:



Advertisements
Similar presentations
Web forms and CGI scripts Dr. Andrew C.R. Martin
Advertisements

JavaScript and AJAX Jonathan Foss University of Warwick
AJAX Asynchronous Javascript And XML. AJAX A lot of hype –It has been around for a while –Not complex Powerful approach to building websites –Think differently.
JQUERY/AJAX ALIREZA KHATAMIAN DELARAM YAZDANSEPAS.
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
Multiple Tiers in Action
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
Web Publishing 3  Meeting 2 1. Learning Outcomes  Configure float  Configure fixed positioning  Configure relative positioning  Configure absolute.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
Application Development Description and exemplification of server-side scripting language for server connection, database selection, execution of SQL queries.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
INTERNET APPLICATION DEVELOPMENT For More visit:
Internet Applications Spring Review Last week –MySQL –Questions?
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
JavaScript & jQuery the missing manual Chapter 11
Databases.  Multi-table queries  Join ▪ An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. 
Server-side Scripting Powering the webs favourite services.
PHP – MySQL Extensions. Table used in most examples CREATE TABLE product ( rowID INT NOT NULL AUTO_INCREMENT, productid VARCHAR(8) NOT NULL, name VARCHAR(25)
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Introduction to MySQL Lab no. 10 Advance Database Management System.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
Intro to LAMP Programming Presented for CIS Faculty at SAC by Dan Zollars.
Technology & Management Club Development Software Overview.
System Initialization 1)User starts application. 2)Client loads settings. 3)Client loads contact address book. 4)Client displays contact list. 5)Client.
Database Access with PHP and MySQL CS356 Examples from Web Database Applications, by Hugh E. Williams & David Lane, O'Reilly, 2002.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
Creating PHPs to Insert, Update, and Delete Data CS 320.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Design: Basic to Advanced Techniques Fall 2010 Mondays 7-9pm 200 Sutardja-Dai Hall Introduction to PHP.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
SYST Web Technologies SYST Web Technologies AJAX.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Lukasz Kokoszkiewicz. Allow to additionally filter main table content All of them can be added by simply in a settings file Right now we have 4 kinds.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
JQuery and AJAX WEB Technologies : PHP Programming Language.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Display Page (HTML/CSS)
Javascript AJAX HTML WEB SERVER Asynchronous. Javascript HTML events DOM – document object model browser internal view of html page compute.
JQuery form submission CIS 136 Building Mobile Apps 1.
How to consume a RESTful service using jQuery. Introduction  In this post we see how to consume the RESTful service described in the post Design a RESTful.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
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.
Mobile Web Design Best Practices Three Approaches to Mobile Web: ◦ Develop a new mobile site with a.mobi TLD ◦ Create a separate website hosted within.
© 2004 D. J. Foreman T&F-1 CS205 Tables & Forms. T&F-2 ©2007 D. J. Foreman Tables.
PHP (Session 2) INFO 257 Supplement.
JavaScript and Ajax (Ajax Tutorial)
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Web Browser server client 3-Tier Architecture Apache web server PHP
Ajax and JSON (jQuery part 2)
jQuery form submission
JavaScript & jQuery AJAX.
PHP: Combo box FdSc Module 109 Server side scripting and

PHP Forms and Databases.
Introduction to HTML: Forms
Database Access with PHP and MySQL
Software Engineering for Internet Applications
Presentation transcript:

Introduction to jQuery

Ajax The jQuery $.post() method loads data from the server using an HTTP POST request. Syntax $.post(URL, {data}, function(data){…}); $.post("myScript.php", {name:txt}, function(result) {     $("span").html(result);   }); ajax.php Parameter Description URL Required. Specifies the url to send the request to. data Optional. Specifies data to send to the server along with the request. function(data) Optional. Specifies a function to run if the request succeeds. data - contains the resulting data from the request http://www.w3schools.com/jquery/ajax_post.asp

Get this from the Ajax call show_product.php <?php $id = $_POST['id']; mysql_connect("localhost", "omuser", "omuser") or die("Error connecting"); mysql_select_db("om") or die("Error selecting DB"); $query = "SELECT * FROM items WHERE item_id = $id"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { echo "Product ID $id not found."; return; } $row = mysql_fetch_array($result); echo "<strong>Item ID:</strong> {$row['item_id']}<br>"; echo "<strong>Title:</strong> {$row['title']}<br>"; echo "<strong>Artist:</strong> {$row['artist']}<br>"; echo "<strong>Price:</strong> {$row['unit_price']}<br>"; Get this from the Ajax call

Ajax ajax.php $('#show').click(function(){ var prodId = $('#id').val(); $.post( "show_product.php", {id:prodId}, function(result) { $('#detail').html(result); } ); }); When the button is clicked Get the text box value Ajax POST Name of the PHP script The key/value to be passed Update the "detail" div With the output of the PHP script