Ajax Rails Tests

Note: if you are testing in Netscape Navigator or Firefox for Firefox <= 1.0 you cannot run these tests locally on your computer. You must run them from http://forkjavascript.org/ajax/tests . This is because these old browsers will not allow POST requests to localhost.

Examples

  1. isSupported
  2. Accept
  3. Format

isSupported

GO!

Accept

Uses method "PUT" and automatically evaluates the returned JavaScript. You should see an alert that says "JavaScript running!" when this request is complete. This example uses the Accept header and sends the request to '/ajax_rails/rails'. Note this won't work in Netscape Navigator 7.0 which is why the format example should be used.

new FORK.Ajax('PUT', '/ajax/rails');

Go!

Format

Uses method "PUT" and automatically evaluates the returned JavaScript. You should see an alert that says "JavaScript running!" when this request is complete. This example uses sends the request to '/ajax_rails/rails.js'.

new FORK.Ajax('PUT', '/ajax/rails.js');

Go!