Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Create 2000-01-01-on-resource-timeout.md #11994

Closed
wants to merge 1 commit into from

2 participants

@Puigcerber

The onResourceTimeout method which is defined in the API Reference WebPage was missing from the website.

@ariya
Owner

Merged. Thanks!

@ariya ariya closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2014
  1. @Puigcerber
This page is out of date. Refresh to see the latest.
Showing with 31 additions and 0 deletions.
  1. +31 −0 _posts/api/webpage/handler/2000-01-01-on-resource-timeout.md
View
31 _posts/api/webpage/handler/2000-01-01-on-resource-timeout.md
@@ -0,0 +1,31 @@
+---
+layout: post
+title: onResourceTimeout
+categories: api webpage webpage-handler
+permalink: api/webpage/handler/on-resource-timeout.html
+---
+
+**Introduced:** PhantomJS 1.2
+
+This callback is invoked when a resource requested by the page timeout according to `settings.resourceTimeout`. The only argument to the callback is the `request` metadata object.
+
+The `request` metadata object contains these properties:
+
+ * `id`: the number of the requested resource
+ * `method`: http method
+ * `url`: the URL of the requested resource
+ * `time`: Date object containing the date of the request
+ * `headers`: list of http headers
+ * `errorCode`: the error code of the error
+ * `errorString`: text message of the error
+
+## Examples
+
+```javascript
+var webPage = require('webpage');
+var page = webPage.create();
+
+page.onResourceTimeout = function(request) {
+ console.log('Response (#' + request.id + '): ' + JSON.stringify(request));
+};
+```
Something went wrong with that request. Please try again.