Loading ...
Sorry, an error occurred while loading the content.

json parsing problem...very peculiar!!!!

Expand Messages
  • JIJO DASGUPTA (ANAND)
    Message 1 of 2 , Jun 8, 2009
    • 0 Attachment
      <!-- 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 == 'true')
      {
      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 -->

      this functions will GET the json response from twitter which is true or false after checking will append new div to the body....

      problem is tht it doesnt seem to be working n i cant find the error...plzz help...
    • Douglas Crockford
      ... Your question is out of scope for this group. Ask the jQuery people.
      Message 2 of 2 , Jun 8, 2009
      • 0 Attachment
        --- In json@yahoogroups.com, "JIJO DASGUPTA (ANAND)"
        > problem is tht it doesnt seem to be working n i cant find the error...plzz help...

        Your question is out of scope for this group. Ask the jQuery people.
      Your message has been successfully submitted and would be delivered to recipients shortly.