> Hi. I am looking for a way by which i can delete the
> records entered
> by a user, if he closes the browser. Ideas please...

> - Ken


<head>
  <script id="browserclose" language="JavaScript" />
  <script language="JavaScript">
    function closeMe() {
      document.getElementById('browserclose').src = 'closeme.cfm';
    }
  </script>
</head>
<body onunload="closeMe();" onbeforeunload="closeMe();">
...
</body>

The onBeforeUnload event handler is an Internet Explorer specific
event handler, however, it behaves the way the onUnload event handler
behaves for all other browsers. IE's onUnload event handler
unfortunately will not produce the desired effect (afaik). When the
window is closed the closeme.cfm page is called and you can do
whatever you need on that page. You should also put anything on that
page in a <cfsilent> tag just to be sure it doesn't produce a
javascript alert for your user. The down-side is the event will fire
if the user navigates to another page as well, so if you need to wait
until the user is actually closing the browser, then you'll need to go
a step further and either use a frameset or iframes to keep the user
on the same page throughout their session, or modify all the links and
forms on the page to set a javascript variable to prevent the onunload
event from loading the closeme.cfm template when a link is clicked or
a form is submitted. Personally I'd use the frameset or iframe
approach -- it has a lot fewer moving parts and should be easier to
develop and less prone to error.



s. isaac dealey   954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186644
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to