PHP Example – Auto-suggest – States The following example code demonstrates how to write a simple auto-suggest mechanism for US States using PHP. Client Code The client code is made up some HTML and some JavaScript. The JavaScript is called whenever the “onkeyup” event is triggered passing the keypress to the autosuggest function: HTML Here ..

Read more

ASP Example – Auto-suggest – States The following example code demonstrates how to write a simple auto-suggest mechanism for US States using ASP. Client Code The client code is made up some HTML and some JavaScript. The JavaScript is called whenever the “onkeyup” event is triggered passing the keypress to the autosuggest function: HTML Here ..

Read more

AJAX Response To retrieve the response data from the server, use either the “responseText” or “responseXML” property of the XMLHttpRequest object. The “responseText” Property Use the “responseText” property when the response from the server is not XML. The “responseText” property returns the response as a string: var response = xmlHttpRequest.responseText; The “responseXML” Property Use the ..

Read more

AJAX Request An AJAX request starts with an XMLHttpRequest object. This object is used to exchange data with the server. The following code fragment shows an example of an AJAX request: xmlHttpRequest.open(“GET”, “ajax_file.txt”, true); xmlHttpRequest.send(); First, an XMLHttpRequest object is created. Second, the “open” method is used to specify the type of the request, the ..

Read more

Introduction AJAX stands for Asynchronous JavaScript and XML. It is a method of exchanging data with a server and updating parts of a web page without having to reload the entire page. This helps make web pages faster and more dynamic. What You Should Already Know To get the most out of this guide, it ..

Read more

Getting Started This section will show step-by-step how to create a simple AJAX application. Step 1: Basic Web Page Start with a basic web page in HTML: <!DOCTYPE html> <html> <head> <title>My Web Page</title> </head> <body> </body> </html> Step 2: Add the Information Section Create a div section and set the id to “ajaxInfo”. This ..

Read more

true JSON has a special value called true which can be set on Boolean data types. Syntax The special value true can be specified after the colon (:) to indiate that the key has a true value. Examples “isEnab..

Read more

String A string is a sequence of characters. Syntax A string begins and ends with quotation marks ("). Any Unicode characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F). Note: Key/value pairs are separated by a comma ..

Read more

Overview The following table lists the JSON basic types: Data Type Description Array An ordered collection of values Boolean A logical data type that is either true or false Number A numeric value in double precision floating-point format Object An unordered collection of key:value pairs String A sequence of characters true Indicates the boolean value ..

Read more

Object An object is an unordered collection of key:value pairs. Syntax Begins With: Left Brace (‘{‘) Ends With: Right Brace (‘}’) Key/value pairs are separated by a comma (‘,’) character. Examples This example is a JSON object that includes a string (“header”) and an array of objects (“items”): { “menu”: { “header”: “Main Menu”, “items”: ..

Read more