×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    9

    Yahoo Pipes/AJAX issue

    Hi,

    I'm pulling in feeds from yahoo pipes in JSON, and the recommended way was to have a script tag linking to it, with a callback (think JSONP). However, given that the user has to authorize the connection, the script executes too soon and in the end nothing happens.

    One solution to this is to use the jQuery $.ajax() method, and set the timeout to a large number (about 45-60 secs), then the ajax call succeeds (it calls my success callback), but the returned result is null.

    Anyone have any insight or another solution to circumvent the issue of authorizing connections messing up their ajax calls?

    Thanks.

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    17

    Post Re: Yahoo Pipes/AJAX issue

    The "problem", probably happen because AJAX request are asynchronous on default. So, you I think the best way to do this, is use something like this:

    /** getting token */
    $.post(_URL , {
    key1=value1,
    key2=value2,
    ... }
    function(data){
    yourCodeGoesHere();
    }, "JSON");

    I hope it could hep.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    9

    Re: Yahoo Pipes/AJAX issue

    Well that is essentially what I do. In the callback function, if I alert the returned data, it's null. I'm thinking that's because while the user is asked for authorization to connect to the Internet from the app, the ajax call executes at that point in time, and by the time the user authorizes, there is no result to be returned since the ajax already executed.

    So I tried setting a very long timeout (60 secs) to give the user enough time to authorize, but even still, the returned result is null.

    Code:
    $.ajax({
    					url: 'http://pipes.yahoo.com/pipes/pipe.run?_id=856b9414b753b5d8b9f5bb056f98bb49&_render=json',
    					dataType: 'json',
    					type: 'get',
    					timeout: 60000,
    					error: function(){
    						alert('error')
    					},
    					success: function(json){
    						alert('success')
    						alert(json)
    						alert('success 2')
    					},
    					complete: function(){
    						alert('complete')
    					}
    				})
    So the success callback fires, the first alert works, the 2nd returns null, and the 3rd never fires.

Similar Threads

  1. issue with at+cusd over bluetooth link
    By hbanks in forum General Messaging
    Replies: 2
    Last Post: 2007-09-25, 21:21
  2. Unable to install Yahoo Go, Gmail after formatting
    By popophobia in forum General Development Questions
    Replies: 2
    Last Post: 2007-03-14, 09:10
  3. RTSP video streaming issue on 6280
    By olivier_irac in forum General Development Questions
    Replies: 0
    Last Post: 2006-12-04, 15:11
  4. Image Scaling/Sizing issue on the N70
    By sameet in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-07-24, 12:03
  5. GPRS Yahoo! Messenger on Nokia 6610
    By calin1980 in forum Smart Messaging
    Replies: 0
    Last Post: 2004-11-16, 03:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×