views:

34

answers:

1

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 sec. then custom error page should display.

A: 

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