Advertisement
Ranga14

AA JSON AJAX Code

Sep 16th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.         $(function() {
  3.             //Calling $.getJSON API
  4.             $.getJSON('http://www.atauction.com/jsonpobject.php&t=title&p=price',
  5.             // No additional parameters sent- If you want you can send below
  6.             {},
  7.             function (data) {
  8.                 // data is now JSON object instantiated from retrieved info
  9.                 $.each(data, function() {
  10.                     //Title
  11.                     var title = val['title'];
  12.                     var title = val['price'];
  13.                     //Insert the data to HTML page
  14.                     $(".title").append(title);
  15.                     $(".price").append(price);
  16.                 });
  17.             });
  18.         });
  19.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement