Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 21st, 2013  |  syntax: JavaScript  |  size: 0.29 KB  |  views: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $.ajax({
  2.                 type: 'GET',
  3.                 url: 'hobby_search.php',
  4.                 data: { term: txt },
  5.                 dataType: 'json', // Choosing a JSON datatype
  6.              success: function(data) {
  7.                                 var JSONArray = $.parseJSON( data );
  8.                                 console.log(JSONArray);
  9.                         },
  10.                 error: function() {alert("Error. Try later.");}
  11.         });