RE: Parameter Passing
by Klaas De Waele <klaas(at)gracegraphics.be>
|
| Date: |
Wed, 3 Oct 2001 16:14:23 +0200 |
| To: |
"'David.Artiss(at)boots.co.uk'" <David.Artiss(at)boots.co.uk>, "'hwg-techniques(at)hwg.org'" <hwg-techniques(at)hwg.org> |
| Cc: |
"'Charlton, Mark'" <Mark.Charlton(at)saint-gobain.com> |
| |
todo: View
Thread,
Original
|
|
Just a quick thought that will work...
This is the official version, meaning you would have to do like this:
blahblah.htm?url=http://www.fiatcoupe.com
If you're not using the url= then just replace the ("=") by ("?") or maybe
you can just skip the line as a whole and replace pairs[1] by query (though
I think the question mark gets passed on).
so... presuming you're linking to redirect.html?url=http://www.fiatcoupe.net
just put this in your redirect.html
<script>
var query = location.search.substring(1);
pairs = query.split("=");
document.write('<a href="' + pairs[1] + '" target=_blank>Yes</a>');
</script>
Then I think you'll be able to cope with the close window thing. Maybe
something like onblur=self.close(); and don't forget to put
onload=self.focus(); in your redirect.html body tag, as otherwise when a
user blurs the window then click another link "nothing" will happen (window
stays in background).
Happy scripting!
- Kayjey -
> -----Oorspronkelijk bericht-----
> Van: owner-hwg-techniques(at)hwg.org
> [mailto:owner-hwg-techniques(at)hwg.org]Namens David.Artiss(at)boots.co.uk
> Verzonden: woensdag 3 oktober 2001 15:23
> Aan: hwg-techniques(at)hwg.org
> CC: Charlton, Mark
> Onderwerp: Parameter Passing
>
>
>
>
> If anybody can assist on the following problem it will be appreciated.
>
> The aim is to replace links on my site to external sites with
> a pop-up box that
> will warn that they are now leaving the site. They click to
> continue and it will
> then launch the site. I want to use a universal bit of code
> for the pop-up box,
> so therefore need to pass to it the URL that it needs to jump to.
>
> The following is the replacement anchor code I'd use to
> display the pop-up
> box....
>
> <a href="javascript:void(0);" onClick=
> "javascript:window.open('redirect.html?/','Ex
> ternal','width=300,height=200');"
> >Click here</a>
>
> Note how I'm passing the URL to link to after the question
> mark. So in this
> example, clicking "Click here" will launch redirect.html
> which will confirm they
> are leaving my site and prompt to continue. When they do it
> will launch a new
> window with hwg.org in it.
>
> The pop-up program is redirect.html and this simply displays
> a message and then
> runs a script to open the URL in a new window if the user
> agrees to continue.
> It's extracting that URL from the above window.open code that
> I am having
> problems with. Anybody able to suggest a way to do it ?
>
> Thanks.
> David.
>
>
>
>
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.