Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Timed Redirect with warning to multiple pages

Reply
Thread Tools

Timed Redirect with warning to multiple pages

 
 
lonlyboy
Guest
Posts: n/a
 
      05-30-2009
I'm looking for a script I can use that warns a user they are leaving
my site. Then after like 5 seconds continues on to the site. I have
a list of about 100 links and I don't want to have to create a
seperate page for each link. Would be nice to setup a page that I can
use a script on.

i.e. page?link=google.com

This would display my warning page for 5 seconds then continue on to
google.com

or page?link=hotmail.com

This would show my warning ofr 5 seconds and continute on to
hotmail,com .. .etc..

Anyone know of a way to script this?

Thanks
LonlyBoy
 
Reply With Quote
 
 
 
 
Trevor Lawrence
Guest
Posts: n/a
 
      05-30-2009
Try this

<html>
<head>
<title>Redirect</title>
<script type="text/javascript">
function redir(url) {
document.write("You will be redirected in 5 seconds")
setTimeout('location.href="' + url + '"',5000)
}
</script>
</head>
<body>
<input type="button" value="Redirect" title="Redirect"
onclick="redir('rollover.html')" />
</body>
</html>

The filename between onclick="redir(' and ')" is the URL that you want to go
to

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org



"lonlyboy" <> wrote in message
news:4a119234-fb3a-490c-8f04-...
> I'm looking for a script I can use that warns a user they are leaving
> my site. Then after like 5 seconds continues on to the site. I have
> a list of about 100 links and I don't want to have to create a
> seperate page for each link. Would be nice to setup a page that I can
> use a script on.
>
> i.e. page?link=google.com
>
> This would display my warning page for 5 seconds then continue on to
> google.com
>
> or page?link=hotmail.com
>
> This would show my warning ofr 5 seconds and continute on to
> hotmail,com .. .etc..
>
> Anyone know of a way to script this?
>
> Thanks
> LonlyBoy



 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-30-2009
lonlyboy wrote:
> I'm looking for a script I can use that warns a user they are leaving
> my site.


No, you don't. Trust me.


PointedEars
 
Reply With Quote
 
The Natural Philosopher
Guest
Posts: n/a
 
      05-30-2009
Thomas 'PointedEars' Lahn wrote:
> lonlyboy wrote:
>> I'm looking for a script I can use that warns a user they are leaving
>> my site.

>
> No, you don't. Trust me.
>


Don't what?

I am looking..no you are not..surely?

>
> PointedEars

 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      05-30-2009
On May 30, 5:17*am, The Natural Philosopher <t...@invalid.invalid>
wrote:
> Thomas 'PointedEars' Lahn wrote:
> > lonlyboy wrote:
> >> I'm looking for a script I can use that warns a user they are leaving
> >> my site.

>
> > No, you don't. *Trust me.

>
> Don't what?
>
> I am looking..no you are not..surely?
>


You are babbling. The point is that it is a stupid idea. The only
sound advice is to skip it.
 
Reply With Quote
 
Mike Duffy
Guest
Posts: n/a
 
      05-30-2009
David Mark <> wrote in news:3e3b3106-4df8-44cf-a1a9-
:

> On May 30, 5:17*am, The Natural Philosopher <t...@invalid.invalid>
> wrote:
>> Thomas 'PointedEars' Lahn wrote:
>> > lonlyboy wrote:
>> >> I'm looking for a script I can use that warns a user they are leaving
>> >> my site.

>>
>> > No, you don't. *Trust me.

>>
>> Don't what?
>>
>> I am looking..no you are not..surely?
>>

>
> You are babbling. The point is that it is a stupid idea. The only
> sound advice is to skip it.
>


A much less obnoxious alternative is simply to append the text " (External
Link)" to the href (alt attribute) and img (title attribute) tags.
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      05-30-2009
On May 30, 11:29*am, Mike Duffy <resp...@invalid.invalid> wrote:
> David Mark <dmark.cins...@gmail.com> wrote in news:3e3b3106-4df8-44cf-a1a9-
> e63632620...@r37g2000yqd.googlegroups.com:
>
>
>
> > On May 30, 5:17*am, The Natural Philosopher <t...@invalid.invalid>
> > wrote:
> >> Thomas 'PointedEars' Lahn wrote:
> >> > lonlyboy wrote:
> >> >> I'm looking for a script I can use that warns a user they are leaving
> >> >> my site.

>
> >> > No, you don't. *Trust me.

>
> >> Don't what?

>
> >> I am looking..no you are not..surely?

>
> > You are babbling. *The point is that it is a stupid idea. *The only
> > sound advice is to skip it.

>
> A much less obnoxious alternative is simply to append the text " (External
> Link)" to the href (alt attribute) and img (title attribute) tags.


You've got the attributes backwards.
 
Reply With Quote
 
Mike Duffy
Guest
Posts: n/a
 
      05-30-2009
David Mark <> wrote in
news:04d7238b-5625-415e-9642-:

> On May 30, 11:29*am, Mike Duffy <resp...@invalid.invalid> wrote:
>>
>> A much less obnoxious alternative is simply to append
>> the text "(External Link)" to the href (alt attribute)
>> and img (title attribute) tags.

>
> You've got the attributes backwards.


Upon sober reflection, I believe you are correct.
(href title="..text"; img alt="..text")
 
Reply With Quote
 
Osmo Saarikumpu
Guest
Posts: n/a
 
      05-31-2009
Mike Duffy wrote:

> Upon sober reflection, I believe you are correct.
> (href title="..text"; img alt="..text")


Still not good. The alt attribute is for alternative text, in case the
image is not displayed for a reason or another. The title attribute
(advisory title) would be proper for both, links and images.

HTH, Osmo

 
Reply With Quote
 
Osmo Saarikumpu
Guest
Posts: n/a
 
      05-31-2009
Trevor Lawrence wrote:

> Try this


For what?¹

> <html>
> <head>
> <title>Redirect</title>
> <script type="text/javascript">
> function redir(url) {
> document.write("You will be redirected in 5 seconds")
> setTimeout('location.href="' + url + '"',5000)
> }
> </script>
> </head>
> <body>
> <input type="button" value="Redirect" title="Redirect"
> onclick="redir('rollover.html')" />


This does not look good. What happens if there is no JavaScript support
available?

¹ http://www.netmeister.org/news/learn2quote.html

Best wishes,
Osmo



 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
Timed redirect of web page Lloyd Sheen ASP .Net 2 12-04-2003 05:55 PM
DLLHOST --asp pages timed out Glenn Lankin ASP General 1 09-30-2003 02:52 AM
timed redirect to another page FN Javascript 3 07-12-2003 06:39 AM
System.Web.HttpException: Request timed out - [HttpException (0x80004005): Request timed out.] Steve ASP .Net 0 07-01-2003 12:11 AM



Advertisments
 



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