[Javascript] location redirect
Tim Makins
spindrift at oceanfree.net
Fri Nov 19 10:14:57 CST 2004
MessageWith so many pop-up blockers these days, why not just have the question on a 'leaving' page, where a 'no' takes you javascript:back, or make a CSS box visible with the question in it?
Tim in Ireland.
----- Original Message -----
From: Grinwald, Uri
To: javascript at LaTech.edu
Sent: Friday, November 19, 2004 3:57 PM
Subject: [Javascript] location redirect
Hello
I have a unique codign question and was wondering if there was a smarter way of performing the task at hand.
I have a few links on my website that have URL whick take them to external sites (opens new window)
I have been asked to create a pop up that informs the user that they are leaving our site and then asks them if they want to proceed by clicking OK or Cancel respectively.
The Cancel button closes the window with the following code:
<form><input type=button value="Cancel" onClick="javascript:window.close();">
</form>
The OK button I have attached a function that offers them one more chance (confirm box) that they can cancel out of before redirecting.
Here is the function:
function confirm_entry()
{
input_box=confirm("Are you sure you want to leave dundeeprecious.com ?");
if (input_box==true)
{
document.location.href = "http://www.tse.com/HttpController?GetPage=QuotesViewPage&DetailedView=DetailedPrices&Language=en&QuoteSymbol_1=dpm";
}
else
{
// Output when Cancel is clicked
window.close();
}
}
-->
</script>
My problem is that the initial page has actually three separate external links so how can I change the code to take them to the correct link based on the referrer URL?
Currently I would have to create three similiar pages and just change the location.href code... there has to be an easier way right?
Uri Grinwald
Web Designer
Dynamic Mutual Funds
40 King Street West
55th Floor Scotia Plaza
Tel: 416 365-2437
Fax: 416 365-5602
------------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20041119/99ba43b2/attachment.htm>
More information about the Javascript
mailing list