Course Hero Logo

Ajax_Intro.doc - Introduction to Javascript AJAX - and help...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 4 pages.

Introduction to Javascript AJAX -- and help individually on Assignment 03 on Javascript patternsRefer to:Week11Assignment01IT 202 manual for additional detailed Ajax examples.Illustrate Ajax framework with simplehelloprogram:Usebasic Ajax html templatewith onkeyup event and target div for the HTML page (hello.html)Build up targethello.phpfrom (incrementally verify/explain effects):1.Initially anon-existentPHP file! – see what happens when Ajax invokes it.2.TheemptyPHP file <?php?>3.Successivelyadd/test where PHPprints"hello" then "Goodbye" – with separate print's4.Then add a<br>tag to first print5.GETthe data sent by the Ajax function and echo it back to browser,6.Use Chrome developer tools (under Network tab), click file name in tool and to view HTTPheader messages exchanged during AJAX exchange.7.Add analert( response ) in handleResponse function before innerHTML statementand observe different content of alert versus content shown in div element.Demo AjaxDB1.html/php (retrieves words from database that start with the string entered in form)Problem:Figure out how to implement the code for AjaxDB1.php:1.Import dictionary.txt into database table.2.Connect to database3.Define SQL query $s that selects words from database dictionary table that begin with thestring of characters sent by browser – use SQLlikeoperator.4.Run query $s and save results in $t5.Use while loop to process $t and send results to Ajax function (via print statements).Key points about AJAX framework1.Create HTTP objectBoilerplate use of createRequestObject function to make http object (code used depends on thebrowser!)Notice definition versus execution of the function!2.Send Request to serversndReq function to send http request to web server.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 4 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture