View Full Version : Resolved JS: Redirect user or remember user decision in cookie

01-10-2012, 10:27 PM
Sorted! (Almost)

1) Project Details:
I require a Javascript that operates identically to www.rackspace.com's location detection - if you're from the UK on their US site, it provides a link to their .co.uk domain but also has the option to continue on the "wrong" site and not re-prompt.

I already have a php script (as part of in ExpressionEngine) that can write out a variable if user is a UK user on US site (or US on UK site), so no need for location detection in script. I need cookie to be written via Javascript.

Script should show a box in middle of screen, semi-transparent black background (CSS - I can do this if need) with two options: Redirect to UK (or US) site or continue on current site and not show up again until cookie expires or is cleared.
If they click on the redirect, no need to write cookie, just redirect (they'll be prompted again if they go back on US site).
If they click on continue, then the cookie is written to remember that and not display option again.

Script will apply to two domains.

2) Payment method/ details:
Payment by Paypal.
Timeline - 24hours!