JSON (JavaScript Object Notation) is like XML, because they are hierarchical, human readable and can be parsed using programming languages. But JSON is quicker, lightweight and more appealing than XML. Here we are going to use PHP generated JSON data and display its value in different element using jQuery Ajax method. Method 1 (Using getJSON) This method loads JSON encoded data from server using GET HTTP request. Using JSON data structure this example simply sets the content of specified elements with JSON value. $.getJSON(“process.php”, function(response) { $(‘#result’).html(response.first); $(‘#result2’).html(response.second); $(‘#result3’).html(response.third); }); Method 2 (Using jQuery Ajax) This is
The post How to use Ajax to display your JSON Data appeared first on Coding Security.
How to use Ajax to display your JSON Data
read more
Tidak ada komentar:
Posting Komentar