Jump to content

Last bit of data


IndianaGuy

Recommended Posts

Javascript is the only thing that directly responds to user interaction. You can run a function when the page is unloaded (which will also happen if they just go to a different page), or the window object does have a close event also.

Link to comment
Share on other sites

No, you can have Javascript send data to PHP (although since the window is closing you'll want to test to make sure that works correctly), but PHP itself can't interact with the browser directly. Only Javascript can, so you need to start with Javascript. Javascript can't write to a text file though, so you need to have it send data to PHP to save on the server.

Link to comment
Share on other sites

I am pretty sure I am on the right track, but not there yet. How is this so far?

 

<body onbeforeunload="myLeaving()">
 
<script>
 
function myLeaving(){
var Expo = document.getElementById("exposure"); // This is a video
var ct = ConvertTime(Expo.currentTime);
var Action = " He left the domain";
RecordAction(Member,Prospect,FileName,Action,ct);
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...