I have to make a function that have to make a get into a public url, it will return me a plain text wich.
Depending on that i will make a validation.
I try to make it with the dojo ajax get method but since is a different domain it will not work ( only on Explorer).
How I can make that call to the external domain and manage the answer.
the url will be something like this.
http://my.socket:8080/?option1=1&option2=2
It can be with ajax or just a java class.
ajax is working on client side which means you are not able to make foreign domain ajax calls due to http://en.wikipedia.org/wiki/Same_origin_policy
it will be good technique if you write that GET call in your applications server side and make ajax call to your application which will act as gateway and fetch data from remote server
Due to same origin policy, you cannot do simple ajax calls across cross domains.
You can ajax call your own server page which resides on same domain and that page can do HTTP get and get the content for you.
or you can use YQL
var url = 'http://my.socket:8080/?option1=1&option2=2'; // website you want to scrape
var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="' + url + '"') + '&format=json&callback=?';
$.getJSON(yql,function(data){
if(data.query.results){
var result = data.query.results.double.content.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, '');
alert(result);
}
});