Well, there is always MochiKit.Async.loadScript for cross-domain stuff...

See the callback code here for example:

https://github.com/mochi/mochikit/blob/master/packed/MochiKit/customize.html

/Per

16 feb 2011 kl. 22:30 skrev Fredrik Blomqvist <fblomqv...@gmail.com>:

> You're confusing loadJSONDoc with a JSONP/XSS call.
> loadJSONDoc uses standard xmlhttprequest, thus your call to twitter
> fails due to the same domain restrictions.
> Currently MochiKit doesn't have a JSONP call. Could be added though,
> this has been discussed before.
> Something like this should work (using the same Deferred interface).
> http://web.archive.org/web/20080608205055/trac.mochikit.com/wiki/loadJSONDocFAD
> 
> // Fredrik Blomqvist
> 
> On Feb 16, 4:28 pm, Salvatore <artyp...@gmail.com> wrote:
>> Sorry I have corrected my errors.
>> The problem now is that my field  ctx.user.data is not modified...
>> 
>> function FormController(){
>>     this.user = {
>>     name: "ALBATOR",
>>     valide: true,
>>     data : "TEST"
>>     }
>> 
>> }
>> 
>> FormController.prototype = {
>>     fetchdata: function () {
>>         this.user.data = "Loading...";
>>         var d = loadJSONDoc("http://search.twitter.com/search?
>> q=artyprog");
>>         var x = this;
>>         var gotMetadata = function (ctx, meta) {
>>             alert(ctx.user.name);
>>             ctx.user.data = meta.results[0].text;
>>         };
>>         var metadataFetchFailed = function (err) {
>>             alert("The metadata for MochiKit.Async could not be
>> fetched :(");
>>         };
>>         d.addCallback(gotMetadata, this);
>>         d.addErrback(metadataFetchFailed);
>> 
>>     },
>>     save: function () {
>>         alert(angular.toJson(this.user));
>>     }
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> }
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "MochiKit" group.
> To post to this group, send email to mochikit@googlegroups.com.
> To unsubscribe from this group, send email to 
> mochikit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/mochikit?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com.
To unsubscribe from this group, send email to 
mochikit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en.

Reply via email to