Class bbq.ajax.ForwardingJSONRequest

Extends bbq.ajax.JSONRequest.
Defined in: ForwardingJSONRequest.js.

This class is designed to be used with the org.bbqjs.spring.ajax.RequestForwarder class and attepts to work around the same origin policy of most browsers in terms of AJAX. The policy means that you can only dispatch an AJAX request to the server from which the JavaScript dispatching the request was loaded. So if you deliver your code from http://www.example.org, you cannot make a request to http://api.google.com. The RequestForwarder class will forward on the request to the location specified in the url property of the options argument, even if it's a different domain. Other than that it behaves in the same way as bbq.ajax.JSONRequest


var request = new bbq.ajax.ForwardingJSONRequest({
    url: "http://api.google.com",
    onSuccess: function(serverRequest, json) {

    }
    ... // more args similar to bbq.ajax.JSONRequest
});

Class Summary
Constructor Attributes Constructor Name and Description
 
bbq.ajax.ForwardingJSONRequest(options, options)
This class is designed to be used with the org.bbqjs.spring.ajax.RequestForwarder class and attepts to work around the same origin policy of most browsers in terms of AJAX.
Fields borrowed from class bbq.ajax.AJAXRequest:
options

Constructor Detail

bbq.ajax.ForwardingJSONRequest(options, options)

Parameters:
Name Type Comment
options {Object}
options