onUnload to Save Data to Database
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
example only
Code: Select all
<script>
var linkage = document.framesї1].links;
for(var x = 0, j = linkage.length; x < j; x++)
{
if(linkageїx].onload != null)
{
// it has an onload attached.. needs special processing
}
else
{
// it didn't have an onload
linkageїx].onload = ""; // whatever code you need here..
}
}</script>- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Nice tips, feyd.
Fellas, with feyd's tips and dozen changes I came into this: http://scorphus.no-ip.com/lab/frames2/ . I think it's a bit complicated, but it can become an option. Well, I hope, it took me almost 3/2 hours
Cheers,
Sco.
Fellas, with feyd's tips and dozen changes I came into this: http://scorphus.no-ip.com/lab/frames2/ . I think it's a bit complicated, but it can become an option. Well, I hope, it took me almost 3/2 hours
Cheers,
Sco.
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
I made some modifications to not loose changes or have duplicated data when user hits 'Save' button and then goes to another page. Frames3: http://scorphus.no-ip.com/lab/frames3/
Scorphus.
Scorphus.
I had attempted to do something similar here:
http://www.fopo.net/south/scripts/timecounter/
It is a counter that tracks how long the person has been on your website and then submits it into an iframe onUnload. The only problem I had was that the page would close before the form finished submitting and the data was saved, so I used an alert to stall long enough for the page to finish loading in the iframe.
http://www.fopo.net/south/scripts/timecounter/
It is a counter that tracks how long the person has been on your website and then submits it into an iframe onUnload. The only problem I had was that the page would close before the form finished submitting and the data was saved, so I used an alert to stall long enough for the page to finish loading in the iframe.
-
Guilherme Blanco
- Forum Newbie
- Posts: 12
- Joined: Wed Jun 02, 2004 4:58 pm
- Location: São Carlos - SP/Brazil
- Contact:
You simply have to use JavaScript RPC of Paul Whitrow...
Call a javascript function that calls the PHP code to execute.
Look at the link: http://www.alphafilter.com/go.foo/article/?aid=10/
Regards,
Call a javascript function that calls the PHP code to execute.
Look at the link: http://www.alphafilter.com/go.foo/article/?aid=10/
Regards,