jijodasgupta Posted June 8, 2009 Share Posted June 8, 2009 <!-- this is the javascript json parser function --> <script type="text/javascript" src="../jquery-1.2.6.min.js"> </script> <script type="text/javascript"> $(document).ready(function() { $('form#search').bind("submit", function(e) { e.preventDefault(); $('#content').html(''); var query1 = urlencode($('input[name="user_a"]').val()); //userA var query2 = urlencode($('input[name="user_b"]').val()); //userB $.ajax('http://twitter.com/friendships/exists.json?user_a='+query1+'&user_b='+query2, function(data,textdata) { if(data == 'false') { var newDiv = '<p>true</p>'; } $('#content').append(newDiv); }, 'text'); }); }) function urlencode(str) { return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); } }) </script> <!-- javascript ends here --> it doesnt seem to be working....wats wrong wth it... Link to comment https://forums.phpfreaks.com/topic/161372-parsing-json-using-jquery/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.