RussellReal Posted February 23, 2011 Share Posted February 23, 2011 First, let me start by saying I'm not a porn site or a hacker.. So please no moral debate, I will explain exactly what I want it for in a moment. Basically what I need is something that will listen for when a page starts loading, to cancel the loading and then load up a different page Basically I have an iFrame which points to someone else's Java applet, I don't take credit away from them at all. That java applet if you click the close button, it will redirect the browser's top.location, instead of the frame that it is in.. Which then redirects the users away from my site.. I simply want to keep them on MY site until they navigate away from my page manually or if they close the browser. thanks Quote Link to comment https://forums.phpfreaks.com/topic/228544-need-to-prevent-users-from-leaving-my-site/ Share on other sites More sharing options...
.josh Posted February 23, 2011 Share Posted February 23, 2011 Well...I'm not entirely sure if this will work or not, seeing as how link is in a java applet and I'm not sure how java applets really behave...but you can try <body onUnload="location.href=location.href;"> Though TBH, IMO it's still bad form to do something like this. Better to get the owner of the java applet to change their code or cut them from your site. Quote Link to comment https://forums.phpfreaks.com/topic/228544-need-to-prevent-users-from-leaving-my-site/#findComment-1178420 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.