Requests and ResponsesAPI Links
Evaluating a RequestA request object is available during page requests and callbacks and is accessed as Jaxer.request. The Jaxer.Request object contains data about the current request:
Getting Data About a RequestLocating the Requested Page on DiskSometimes it's necessary to be able to locate the file or directory of the current request on disk. This example returns the location of the file in the requested URL and not, say, the location of the JavaScript file in which the Jaxer.request call is made. For more details on working with files, please refer to the Files chapter. Preparing the ResponseA response object is available during page requests and callbacks and is accessed as Jaxer.response. The Jaxer.Response object contains data to be returned to the browser as the response to a request. With the response object you can:
Redirecting to Another URLOverriding Returned ContentThis example shows how to replace the entire content of the response with JSON data. You could also use this
technique to return dynamically rendered CSS.
|
