Hi everyone.

I wrote code for JSONP to Async.

http://rails2u.com/misc/MochiKitAsyncJSONP/AsyncJSONP.js
http://rails2u.com/misc/MochiKitAsyncJSONP/ (DEMO)

DEMO is able to get JSON from del.icio.us by JSONP.

DEMO's Implementation example code is like this.
// ------------
var d = sendJSONPRequest('http://del.icio.us/feeds/json/' +
$('uid').value, 'callback');
d.addCallback(function(json) {
    replaceChildNodes($('result'), UL(null, map(function(data) {
        return UL(null, A({href: data.u}, data.d));
    }, json)));
});
// ----------

sendJSONPrequest is MochiKit.Async's function.
- sendJSONPRequest(url, callback_query, timeout/* = 30 */, _options/*
optional */)

sendJSONPRequest's first arguments is JSON url.
 example: http://del.icio.us/feeds/json/gorou

second arguments is query callback params name.
If del.icio.us's API callback name is 'callback'.

third arguments is request timeout second.
If over timeout second. call errback. But don't work opera...
Opera's element.appendChild(script) don't ASYNC.

forth arguments is script element attributes.
example:
sendJSONPRequest(url, callback_query, timeout, {
  charset: 'utf-8'
});

If you like AsynJSON.js, please Fetch in AsyncJSON.js's code to
MochiKit.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to