Tag javascript array

Javascript JSON – Introduction

JSON Example This example is a JSON string: ‘{“name”:”John”, “age”:30, “car”:null}’ It defines an object with 3 properties: name age car Each property has a value. If you parse the JSON string with a JavaScript program, you can access the…

Javascript AJAX Database Example

AJAX can be used for interactive communication with a database. Example – The showCustomer() Function When a user selects a customer in the dropdown list , a function called showCustomer() is executed. The function is triggered by the onchange event:…

Javascript AJAX PHP Example

AJAX is used to create more interactive applications. Example In the example , when a user types a character in the input field, a function called showHint() is executed. The function is triggered by the onkeyup event. Here is the…

Javascript AJAX XML Example

AJAX can be used for interactive communication with an XML file. Example When a user clicks on the “Get CD info” button , the loadDoc() function is executed. The loadDoc() function creates an XMLHttpRequest object, adds the function to be…

Javascript AJAX – Server Response

Server Response Properties Property Description responseText get the response data as a string responseXML get the response data as XML data The responseText Property The responseText property returns the server response as a JavaScript string, and you can use it…

Javascript AJAX – XMLHttpRequest

The XMLHttpRequest object is used to request data from a server. Send a Request To a Server To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object: xhttp.open(“GET”, “ajax_info.txt”, true); xhttp.send(); Method…

Javascript AJAX – The XMLHttpRequest Object

The keystone of AJAX is the XMLHttpRequest object. Create an XMLHttpRequest object Define a callback function Open the XMLHttpRequest object Send a Request to a server The XMLHttpRequest Object All modern browsers support the XMLHttpRequest object. The XMLHttpRequest object can…

Javascript AJAX Introduction

AJAX is a developer’s dream, because you can: Read data from a web server – after the page has loaded Update a web page without reloading the page Send data to a web server – in the background AJAX Example…

Javascript Web Geolocation API

Locate the User’s Position The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise privacy, the position is not available unless the user approves it. Note Geolocation is most accurate for devices…