Tag Archives: javascript

Cross domain requests

I created a CrossDomainPage action to use for cross domain AJAX requests in the browser. It gets a URL in the url parameter, makes a request to that URL and copies the results to the crossdomain.jsp (through the html attribute).

You can make a cross domain request from the browser by using the Mint2.crossDomainPage function like this:

Mint2.crossDomainPage("http://the.url.com", function(response) {
    // This is a callback that gets the results in the response variable
});

PS. I thought I needed it for the documentation functions, but I didn’t use it after all. If we ever need such a functionality, we can build on that.