<strong>PHP</strong> Parameters <strong>and</strong> Error H<strong>and</strong>lingrealtime SVG chartingerror_h<strong>and</strong>ler.php, 74, 75, 76, 77 ajaxrequest.js, 194, 200morephp.html, 72 chart.svg, 194, 200morephp.js, 72 index.html, 193, 200morephp.php, 74 realTimeChart.js, 201<strong>PHP</strong>5 errors, 75RealTimeChart.js, 195phpMyAdminsvg_chart.php, 199creating tables, 103refreshXYIndexes() function,installation, 263realTimeChart.js, 201placeholders, 33Relational Database Management Systems,postMessages() function, <strong>AJAX</strong> chat, 163101prediction, user input, 165remote servers, connecting topreparing database, <strong>AJAX</strong>, 264about, 79primary key, MySQL, 101Firefox, 83private class members, 110Internet Explorer, 83process() function, quickstart.js, 23, 26Opera, 84Prototype JavaScript framework, 238ping.html, 81proxy <strong>PHP</strong> script, 85ping.js, 81proxy server script, 85removePointInfo() function, realTimeChart.js,proxy server script for remote access201error_h<strong>and</strong>ler.php, 88 repetitive asynchronous requests, 91proxyping.html, 86repetitive tasks implementationproxyping.js, 86 error_h<strong>and</strong>ler.php, 97proxyping.php, 88 smartproxyping.html, 93public interface, classes, 110smartproxyping.js, 94, 98public members, classes, 110smartproxyping.php, 97requestNewMessages() function, <strong>AJAX</strong> chat,Q162responseText() method, XMLHttpRequest, 47queue, 125responseXML() method, XMLHttpRequest, 47Quickstart <strong>AJAX</strong> applicationretrieveNewMessages() function, <strong>AJAX</strong> chat, 163index.html, 21RSS, 223quickstart.js, 21, 23RSS Reader applicationquickstart.php, 22config.php, 228quickstart application, <strong>AJAX</strong>, 18error_h<strong>and</strong>ler.php, 227index.php, 228, 233Rrss_reader.class.php, 227rss_reader.css, 231rss_reader.js, 229, 234r<strong>and</strong>om numbers, retrieving, 93rss_reader.php, 226, 235RDBMS, 101rss_reader.xsl, 227, 235reading data, remote server, 85readMessages() function, <strong>AJAX</strong> chat, 162readyState() method, XMLHttpRequest, 47 SReally Simple Syndication (RSS)about, 223save() function, 221document structure, 224saveXML() function, 71Google Reader, 224Scalable Vector Graphics (SVG), 189RSS reader application, 226script element, embedding Java code, 30realtime charting with <strong>AJAX</strong>, 190script.aculo.us, 237, 238271
security, browsers, 80drag-<strong>and</strong>-drop.css, 248security, JavaScript, 79drag-<strong>and</strong>-drop.js, 245SELECT comm<strong>and</strong>, MySQL, 104drag-<strong>and</strong>-drop.php, 244, 252selectRange() function, <strong>AJAX</strong> Suggest <strong>and</strong>error_h<strong>and</strong>ler.php, 242Autocomplete, 187 index.php, 242, 249semicolon separator, MySQL comm<strong>and</strong>s, 104script.aculo.us library, 242send() method, XMLHttpRequest, 47taskslist.class.php, 243, 252sendMessage() function, <strong>AJAX</strong> chat, 162TextRange object, <strong>AJAX</strong> Suggest <strong>and</strong>server requests, initiating, 46Autocomplete, 187server response, asynchronous requests, 49 thick client, 8server script, proxy, 85 thin client, 8servers, remote, 79 thread-safe <strong>AJAX</strong>, 125server-side form validation, 121Time for Actionserver-side technologies, 11advanced DOM, 37setFocus() function, JavaScript, 139<strong>AJAX</strong> drag <strong>and</strong> drop, 241setInterval() function, 91<strong>AJAX</strong> Grid, 205setRequestHeader() method,<strong>AJAX</strong> Suggest <strong>and</strong> Autocomplete, 168XMLHttpRequest, 47 asynchronous calls with XMLHttpRequest, 50setSelectionRange() function, <strong>AJAX</strong> Suggestasynchronous Calls with XMLHttpRequest, 55<strong>and</strong> Autocomplete, 187 chat application with <strong>AJAX</strong>, 148SetStyle() method, 41setTimeout() function, 27, 91simple application, <strong>AJAX</strong>, 18SimpleXML API, 71complete <strong>AJAX</strong> application, XE "Time forAction:Friendly <strong>AJAX</strong> application"st<strong>and</strong>ard structure, 112connecting to mySQL database, 106software usability, 8connecting to remote servers, 81sortable lists, drag <strong>and</strong> drop, 238CSS <strong>and</strong> JavaScript, 39st<strong>and</strong>ardization, web applications, 9form validation, 126startup() function, drag <strong>and</strong> drop application,Friendly <strong>AJAX</strong> application, 112249 JavaScript <strong>and</strong> DOM, 32Status() method, XMLHttpRequest, 47JavaScript events <strong>and</strong> DOM, 35statusText() method, XMLHttpRequest, 47<strong>PHP</strong> <strong>and</strong> MySQL, 106string variables, JavaScript, 36<strong>PHP</strong> parameters <strong>and</strong> error h<strong>and</strong>ling, 72Suggest, 165proxy server script, 86Suggest <strong>and</strong> Autocomplete, <strong>AJAX</strong>Quickstart <strong>AJAX</strong> application, 21config.php, 168 realtime SVG chart, 193error h<strong>and</strong>ling, 187 repetitive tasks, 93error_h<strong>and</strong>ler.php, 168 RSS Reader application, 226index.html, 170, 183 task management application, 241suggest.class.php, 169, 188 XML structures with <strong>PHP</strong>, 66suggest.css, 170 transformation, XSL, 203suggest.js, 172, 184 TRUNCATE TABLE comm<strong>and</strong>, MySQL, 102suggest.php, 169, 187 try/catch construct, JavaScript, 43SVG, 189 try/catch mechanism, error h<strong>and</strong>ling, 60, 90syndication, web, 223TUul element, 34ta-da lists, drag <strong>and</strong> drop, 238undo() function, 221task management applicationunobtrusive validation, 139config.php, 241 UPDATE comm<strong>and</strong>, MySQL, 104272
- Page 2 and 3:
AJAX and PHPBuilding Responsive Web
- Page 4 and 5:
CreditsAuthorsCristian DarieBrinzar
- Page 6 and 7:
Filip Cherecheş-Toşa is a web dev
- Page 8 and 9:
Table of ContentsPreface 1Chapter 1
- Page 11 and 12:
Table of ContentsPreparing Your *ni
- Page 13 and 14:
PrefaceWhat This Book CoversChapter
- Page 15 and 16:
PrefaceAny command-line input and o
- Page 17 and 18:
O}EN PORTADAEl aborto...más allá
- Page 19 and 20:
Chapter 1Because end-user satisfact
- Page 21 and 22:
Chapter 1Three points for you to ke
- Page 23 and 24:
Chapter 1With JavaScript, developer
- Page 25 and 26:
interrupting the user from his or h
- Page 27 and 28:
• Creating simple online chat sol
- Page 29 and 30:
Chapter 1done typing. (This method
- Page 31 and 32:
Chapter 1All exercises from this bo
- Page 33 and 34:
etrieve the user name$name = $_GET[
- Page 35:
Chapter 1If you're curious to test
- Page 38 and 39:
AJAX and the Future of Web Applicat
- Page 40 and 41:
Client-Side Techniques with Smarter
- Page 42 and 43:
Client-Side Techniques with Smarter
- Page 44 and 45:
Client-Side Techniques with Smarter
- Page 46 and 47:
Client-Side Techniques with Smarter
- Page 48 and 49:
Client-Side Techniques with Smarter
- Page 51 and 52:
Chapter 2font-size: 10pt;}.TableCon
- Page 53 and 54:
Chapter 2Creating the XMLHttpReques
- Page 55 and 56:
Chapter 2You could, for example, ch
- Page 57 and 58:
You will learn the most interesting
- Page 59 and 60:
Chapter 2The safer version of proce
- Page 61 and 62:
Chapter 24. Create a file called as
- Page 63 and 64:
Chapter 2Figure 2.6: The Four HTTP
- Page 65 and 66:
Chapter 2}}else{// display status m
- Page 67 and 68:
Chapter 2}{// try to create XMLHttp
- Page 69 and 70:
Chapter 2The responseXML method of
- Page 71 and 72:
Chapter 2Figure 2.10: Opera Display
- Page 73 and 74:
I admit that the following piece of
- Page 75 and 76:
3Server-Side Techniqueswith PHP and
- Page 77 and 78:
Chapter 3}for (var i=0; i
- Page 79 and 80:
Chapter 3// create the element$boo
- Page 81 and 82:
Chapter 3// create the root elemen
- Page 83 and 84:
Chapter 3// read a file from the se
- Page 85 and 86:
Chapter 3Figure 3.3: PHP Parameters
- Page 87 and 88:
Chapter 3Without the customized err
- Page 89 and 90:
}}// display the error in case of f
- Page 91 and 92:
Chapter 3Figure 3.7: Connecting to
- Page 93 and 94:
Chapter 3}}// continue only if HTTP
- Page 95 and 96:
Chapter 3You can make Firefox liste
- Page 97 and 98:
Chapter 3}"MSXML2.XMLHTTP.4.0","MSX
- Page 99 and 100:
'TEXT: ' . $errStr . chr(10) .'LOCA
- Page 101 and 102:
etrieve the parameters$num = 1; //
- Page 103 and 104:
Chapter 3Figure 3.16: Flowchart Des
- Page 105 and 106:
}Chapter 3// only continue if xmlHt
- Page 107 and 108:
}throw(response.length == 0 ? "Serv
- Page 109 and 110:
function process(){// ...if (reques
- Page 111 and 112:
Chapter 3Working with MySQLA back-e
- Page 113 and 114:
Chapter 3Figure 3.17: Executing SQL
- Page 115 and 116:
Chapter 3SELECT user_id, user_name
- Page 117 and 118:
3. In your foundations folder, crea
- Page 119 and 120:
Chapter 3After these commands execu
- Page 121 and 122:
Chapter 3• friendly.php is a PHP
- Page 123 and 124:
This example requires a JavaScript-
- Page 125 and 126:
}}// try to connect to the servertr
- Page 127 and 128:
Chapter 3}// create HTML-formatted
- Page 129:
Chapter 3On the server side, all th
- Page 132 and 133:
AJAX Form ValidationThe code in thi
- Page 134 and 135:
AJAX Form ValidationFigure 4.2: The
- Page 136 and 137:
AJAX Form ValidationNote that deali
- Page 138 and 139:
AJAX Form Validation"3" => "March",
- Page 140 and 141:
AJAX Form Validationclass="">Please
- Page 142 and 143:
AJAX Form Validation}}alert("Error
- Page 144 and 145:
AJAX Form Validation// output the e
- Page 146 and 147:
AJAX Form Validationbreak;}}// Chec
- Page 148 and 149:
AJAX Form Validationprivate functio
- Page 150 and 151:
AJAX Form ValidationThe onblur even
- Page 152 and 153:
AJAX Form ValidationAfter this basi
- Page 154 and 155:
AJAX Form ValidationSummaryWhile we
- Page 156 and 157:
AJAX ChatFigure 5.1: MeeboMeebo off
- Page 158 and 159:
AJAX ChatThe messages for the AJAX
- Page 160 and 161:
AJAX Chat// destructor closes datab
- Page 162 and 163:
AJAX Chat}}?>8. Create another file
- Page 164 and 165:
AJAX Chat/* creates an XMLHttpReque
- Page 166 and 167:
AJAX Chat}}xmlHttpGetMessages.send(
- Page 168 and 169:
AJAX Chatfunction handleKey(e){// g
- Page 170 and 171:
AJAX Chat12. After having talked ab
- Page 172 and 173:
AJAX ChatOn pressing the Send butto
- Page 174 and 175:
AJAX ChatSummaryAt the beginning of
- Page 176 and 177:
AJAX Suggest and AutocompleteIt's a
- Page 178 and 179:
AJAX Suggest and AutocompleteTime f
- Page 180 and 181:
AJAX Suggest and Autocomplete170'FR
- Page 182 and 183:
AJAX Suggest and Autocomplete10. Cr
- Page 184 and 185:
AJAX Suggest and Autocomplete}if(ca
- Page 186 and 187:
AJAX Suggest and Autocomplete}if(re
- Page 188 and 189:
AJAX Suggest and Autocomplete}var k
- Page 190 and 191:
AJAX Suggest and AutocompletecrtLin
- Page 192 and 193:
AJAX Suggest and AutocompleteFigure
- Page 194 and 195:
AJAX Suggest and Autocompletewant c
- Page 196 and 197:
AJAX Suggest and AutocompleteNext,
- Page 198 and 199:
AJAX Suggest and Autocompletein sug
- Page 200 and 201:
AJAX Real-Time Charting with SVGFor
- Page 202 and 203:
AJAX Real-Time Charting with SVG0.0
- Page 204 and 205:
AJAX Real-Time Charting with SVG3.
- Page 206 and 207:
AJAX Real-Time Charting with SVG//
- Page 208 and 209:
AJAX Real-Time Charting with SVG//
- Page 210 and 211:
AJAX Real-Time Charting with SVGcoo
- Page 212 and 213:
AJAX Real-Time Charting with SVG•
- Page 214 and 215:
AJAX GridImplementing the AJAX Grid
- Page 216 and 217:
AJAX GridCREATE TABLE product(produ
- Page 218 and 219:
AJAX Grid}// execute the queryif ($
- Page 220 and 221:
AJAX Grid// clear any output that h
- Page 222 and 223:
AJAX Grid212// the id of the grid d
- Page 224 and 225:
AJAX Grid// handle receiving the se
- Page 226 and 227:
AJAX Grid// handle receiving a resp
- Page 228 and 229:
AJAX GridAs usual on the server, we
- Page 230 and 231: AJAX Grid220}{}stylesheetDoc = crea
- Page 233 and 234: 9AJAX RSS ReaderIn the last few yea
- Page 235 and 236: Chapter 9Figure 9.1: Managing RSS S
- Page 237 and 238: header('Pragma: no-cache');header('
- Page 239 and 240: Chapter 9Loading feed...About the A
- Page 241 and 242: Chapter 9}// continue if the proces
- Page 243 and 244: Chapter 9}width: 410px;background-c
- Page 245 and 246: And finally, we send the HTTP reque
- Page 247 and 248: 10AJAX Drag and DropWhen drag-and-d
- Page 249 and 250: Chapter 10The Prototype features ar
- Page 251 and 252: Chapter 10When dropping a task on t
- Page 253 and 254: Chapter 10DROP HERE TO DELETE7. Cre
- Page 255 and 256: header('Expires: Fri, 25 Dec 1980 0
- Page 257 and 258: Chapter 10}}}else if (action =="del
- Page 259 and 260: Chapter 1011. Load http://localhost
- Page 261 and 262: details are saved using a cache sys
- Page 263: Chapter 10SummaryThis is it! You've
- Page 266 and 267: Preparing Your Working EnvironmentT
- Page 268 and 269: Preparing Your Working EnvironmentA
- Page 270 and 271: Preparing Your Working Environment1
- Page 272 and 273: Preparing Your Working EnvironmentA
- Page 274 and 275: Preparing Your Working Environment6
- Page 276 and 277: IndexAabort() method, XMLHttpReques
- Page 278 and 279: exception handling, JavaScript, 43
- Page 282: updateChart() function, realTimeCha