Using jQuery.ajax in a Google Chrome extension

Viewed 32847

I use jquery.ajax function to post data from google chrome extension to my web service as code below:

$.ajax({
            type: "POST",
            url: serviceUrl,
            data: data,
            success: function(msg){
                if(typeof(Me.config.onSumitted) == "function"){
                    Me.config.onSumitted(msg);
                }
           },
           error: function(){
                if(typeof(Me.config.onError) == "function"){
                    Me.config.onError();
                }
           }
         });

but i get an error:

XMLHttpRequest cannot load http://todomain.com/Service.asp. Origin http://fromtabdomain.com is not allowed by Access-Control-Allow-Origin.

how can i resolve it?

5 Answers
Related