Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   cross domain ajax (https://javascript.ru/forum/jquery/32185-cross-domain-ajax.html)

vyaceslav.kr 06.10.2012 15:33

cross domain ajax
 
Привет!
Делаю импорт с помощью php curl
Но нужно использовать кросс доменный ajax
var import_data = {
                        service_key: '...',
                        email_source: 'otherservice',
                        details: '...',
                        description: '...',
                        charset: 'utf-8'
                    }
                    
                    var url = '...';
                    $.ajax({
                        type: 'POST',
                        url: url,
                        dataType: 'json',
                        data : import_data,
                        success: function(json) {
                            console.log(json);
                        }
                    });


Как мне это сделать ? помогите плиз...

qwert_ukg 07.10.2012 09:11

var import_data = {
                        service_key: '...',
                        email_source: 'otherservice',
                        details: '...',
                        description: '...',
                        charset: 'utf-8'
                    }
                    
                    var url = '...';
                    $.ajax({
                        type: 'POST',
                        url: url,
                        dataType: 'jsonp',
                        jsonpCallback: "padding",
                        data : import_data,
                        success: function(json) {
                            console.log(json);
                        }
                    });

json:
padding({"data":data});


Часовой пояс GMT +3, время: 23:17.