I am using Jaxer.Sandbox.open(url,null,openOptions);
method to fetch url contents. I want to find out time required to fetch url content. If this process took long time say more than 6 seconds, then custom error page should display.
Asked
Active
Viewed 166 times
-1

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Anurag
- 93
- 2
- 7
-
And your question is...? – lc. Jun 15 '10 at 03:28
1 Answers
0
If I read your question right,
var sandbox = new Jaxer.Sandbox(url,null,options);
if(sandbox.waitForCompletion(5000))
{
// Page loaded
return {contents:sandbox.toHTML()};
}
else
{
// Took too long
return {error:"Request Timed Out"};
}
That should do the trick.

Na7coldwater
- 1,404
- 12
- 24