[OT] Re: Anyone for JavaScript question
Hi Martin, You could try posting the form to a hidden frame or you could use Javascript remote scripting (JSRS) to communicate the onUnload event to your server. Nigel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster. > The simple onUnload() construction will not work. You will have to open > a new browser window on unload displaying the output of your server program. > > martin > > > Medi Montaseri wrote: > > >I know this is off topic, but I thought someone could use a break... > > > >Given a page called xyz.html, I want to measure the amount of time a > >user spent > >on this screen (or page) along with other usability metrics. So I > >figured I'll use > >JavaScript since its running the entire time the page is up. > > > >Then I decided to use onload() and onunload() events to determine start > >and end > >of the session. > > > >The onload() part is easy. However when onunload() event happens, I need > >to > >execute a server side program and feed it the data that was collected. > > > >So I figured I setup a dumy form and invoke form.submit() onUnload. > >Would this work or is there a better method. > > > >I also thought about a redirect followed by another rediect to where the > >user wanted > >to go, but that gets too browser dependent and I don't like it when > >others hijak my > >browser. > > > > > >-- > >- > >Medi Montaseri [EMAIL PROTECTED] > >Unix Distributed Systems EngineerHTTP://www.CyberShell.com > >CyberShell Engineering > >- > > > > > > > > > >
Re: [OT] Re: Anyone for JavaScript question
hi nigel, i never tried aou JSRS before, so i can't judge about it. but posting the data to a hidden frame might not work on an unload event. imagine the user types in another url and löeaves the whole frameset. but now we're running far WOT ... :) martin Nigel Hamilton wrote: >Hi Martin, > > You could try posting the form to a hidden frame or you could use >Javascript remote scripting (JSRS) to communicate the onUnload event to >your server. > > >Nigel > -- http://www.meome.de --- Martin Haase-Thomas | Tel.: 030 43730-558 meOme AG| Fax.: 030 43730-555 Software Development| [EMAIL PROTECTED] ---
Re: Anyone for JavaScript question
The simple onUnload() construction will not work. You will have to open a new browser window on unload displaying the output of your server program. martin Medi Montaseri wrote: >I know this is off topic, but I thought someone could use a break... > >Given a page called xyz.html, I want to measure the amount of time a >user spent >on this screen (or page) along with other usability metrics. So I >figured I'll use >JavaScript since its running the entire time the page is up. > >Then I decided to use onload() and onunload() events to determine start >and end >of the session. > >The onload() part is easy. However when onunload() event happens, I need >to >execute a server side program and feed it the data that was collected. > >So I figured I setup a dumy form and invoke form.submit() onUnload. >Would this work or is there a better method. > >I also thought about a redirect followed by another rediect to where the >user wanted >to go, but that gets too browser dependent and I don't like it when >others hijak my >browser. > > >-- >- >Medi Montaseri [EMAIL PROTECTED] >Unix Distributed Systems EngineerHTTP://www.CyberShell.com >CyberShell Engineering >- > > > > -- http://www.meome.de -- Martin Haase-Thomas | Tel.: 030 43730-558 meOme AG| Fax.: 030 43730-555 Software Development| [EMAIL PROTECTED] --
Anyone for JavaScript question
I know this is off topic, but I thought someone could use a break... Given a page called xyz.html, I want to measure the amount of time a user spent on this screen (or page) along with other usability metrics. So I figured I'll use JavaScript since its running the entire time the page is up. Then I decided to use onload() and onunload() events to determine start and end of the session. The onload() part is easy. However when onunload() event happens, I need to execute a server side program and feed it the data that was collected. So I figured I setup a dumy form and invoke form.submit() onUnload. Would this work or is there a better method. I also thought about a redirect followed by another rediect to where the user wanted to go, but that gets too browser dependent and I don't like it when others hijak my browser. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -