Posts Tagged ‘JQuery’

Pulling data from Twitter with jQuery

October 21st, 2011

Twitter have made data retrieval pretty damn simple.. I managed to lookup all the info I needed and write this code in just a few minutes.. My requirements were quite simple though, all I had to do was retrieve the top 2 latest tweets from a specific user and display them on a page.

All the documentation you need can be found here: https://dev.twitter.com/docs. To fulfill this requirement I needed to use the following api url: https://api.twitter.com/1/statuses/user_timeline.json. This allows me to retrieve tweets from a user.

Let’s get started..

» Read more: Pulling data from Twitter with jQuery

IE Error when retrieving XML using JQuery .ajax()

June 22nd, 2011

Had an irritating error in IE 9 (and under) when trying to retrieve some XML using jQuery’s $.ajax() function, part of the issue ended up being that the dataType parameter MUST be in capital letters, for example:

This does not work:

$(document).ready(function()
{
  jQuery.ajax({

    type: "GET",
    url: "localXMLFile.xml",
    dataType: "xml",
    success: function( status )
    {
      //Success
    },
    complete: function( status )
    {
      //Complete
    },
    error: function( status )
    {
      //Error
    }
  });
});

» Read more: IE Error when retrieving XML using JQuery .ajax()