[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 06-24-2005, 12:36 AM   #1 (permalink)
NamePros Regular
 
Join Date: Feb 2004
Posts: 631
57.15 NP$ (Donate)

teclance is on a distinguished road


entering timer

Hi guys,

I run an autosurf system and one of the biggest problems when users surf is frame breakers. So I have inserted a small java code that will cause a window to pop up everytime the window is either refreshed, another link is clicked or a site has a frame breaker.

The window that pops up asks the user if they would like to leave the site and if they click yes it will take them to the page they clicked etc... if they click no it will take them back to the page.

Some times my users turn the surfing window on and leave the computer for a while so if a frame breaker occurs they won't be there to click "no" when the window pops up.

So I was hoping that I could put a timer into the java snippet and if there is no response within 30 seconds it would take the user back to the surfing window.

Here is the java code I use and you can try it on your site if you like.

<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var your_message = "Do you really want to leave this page?";
var times = 0;

function onul() {
if (times == 0) {
var leave = confirm(your_message);
if (!leave) location = self.location;
times++;
}
}

//-->
</script>
<body onunload="onul()">

http://www.javascript-page.com/onunload.html


thanks a bunch!
__________________
Sincerely
Mike Kelly
teclance is offline  
Old 06-24-2005, 01:12 AM   #2 (permalink)
NamePros Regular
 
Join Date: May 2005
Location: California
Posts: 506
848.69 NP$ (Donate)

Shockt is a glorious beacon of lightShockt is a glorious beacon of lightShockt is a glorious beacon of lightShockt is a glorious beacon of lightShockt is a glorious beacon of light


Something like this?
http://www.htmlite.com/JS018.php
Shockt is offline  
Old 06-24-2005, 01:17 AM   #3 (permalink)
NamePros Regular
 
Join Date: Feb 2004
Posts: 631
57.15 NP$ (Donate)

teclance is on a distinguished road


hi,

Thank you for that! It looks very close to what I need. Now I got to try and implement that into the above java snippet to close the pop up window and have the surfing window to continue.

Any one know how to do that
__________________
Sincerely
Mike Kelly
teclance is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone care to give me some feedback on my site JTerry00 Web Design Reviews 13 06-04-2005 05:41 AM
my first webstie robsonde Web Design Reviews 20 10-10-2004 01:47 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:32 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85