Posts

Showing posts from July, 2022

XMLHttpRequest Ajax in JavaScript

Image
   Using XMLHttpRequest, Ajax Call  to PHP page, MySQL Data in JavaScript   What is  XMLHttpRequest? XMLHttpRequest is a JavaScript's in-built browser object that allows to make HTTP requests to Server. XMLHttpRequest is used to implement AJAX effect in web application development. Basically XMLHttpRequest (XHR) objects used to interact with servers. It makes You to retrieve data from a URL without refreshing the complete page. This enables a Web page to update just part of a page without interrupting the user what he is doing on a page. In this tutorial to implement Ajax feature in web application,   we are using 3 programs. 1. An HTML page allows the user to send a request to the server.  2. A JavaScript Page, which resides in the middle of the HTML and Server Page, receives the request from the HTML page and sends the request to the server and receives the response and passes it to the HTML page. 3. Server Page here it is a PHP page which will recei...

Read JSON Data in Javascript and jQuery

Image
  Convert JSON Data in JavaScript and jQuery   This tutorial explains how to read JSON data from various sources using JavaScript and jQuery.   1. How to read JSON data from local array . 2. How to read JSON data from external file. 3. How to read JSON data from URL .   1. How to read  local JSON Array in JavaScript?     MenuTop read-json-array-JS.html <!DOCTYPE html> <html> <head> <title>Coding-zon Demo - Read JSON in Javascript </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" >< /script> </head> <body> <h2>How to read a json array in table format using jQuery</h2> <table style= "width: 80%" border= "1" id= "t1" > <thead> <tr> <th>Id< </th> <th>Name </th> <th>Age </th> <th>City </th> </tr> <thead> <tbody> </tb...

JSON Tutorial

Image
Learn JSON      What is JSON? JSON is a format for storing data and exchanging data. JSON is often used to sent data from a server to a web page.   Why JSON:   JSON is widely used in data transfer from source to destination. It is a common format that can be understood by heterogeneous environments. It provides many features, some of them are stated here. JSON stand for JavaScript Object Notation Lightweight data transporting format. Language independent. Text-based and human-readable. It is "self-describing" and easy to understand. Syntax: VAR variablename = { "key1" : " value1 " , "key2" : " value2 " , "key3" : " value3 " }; In JSON, all keys   must be strings, written with double quotation marks: Example: ' { "name" : "John" , "age" : 30 , "email" : "john@example.com" , "phone" : "12341234" } ' ;     JSO...