Splitting from
this thread [webmasterworld.com], I was wondering if there's any way for javascript to submit a form, comprised of hidden fields, transparently and automatically, when a visitor leaves a webpage either for another page on the same site, or a different site altogether. Basically I want to start a javascript timer that times how long the page is viewed. The value would be used in a hidden form field, so that when the form was submitted, it could be processed and aggregated by some server-side script.
So as not to interfere with normal navigation, the form would need to be submitted completely automatically when the current page was left. It would obviously also need to be entirely transparent to the user.
Is this within the range of Javascript? And if so, how would you handle submitting the form automatically like that?
Thanks,
Matthew