/    Sign up×
Community /Pin to ProfileBookmark

window.opener.location not working from https to http

Hi all

I have a real problem with an e-commerce site which has worked for years without a hitch but with the uptake of IE8 (it seems) this problem is getting more and more frequent.

Problem: customer continues through checkout on main site ([url]http://www.abc.co.uk/checkout.php[/url]).

When they have to enter their credit card details, they click on a link to open a window ([url]https://www.abc.co.uk/cc.php[/url]). The details are verified and if valid, the customer is returned to the confirmation page in the parent screen ([url]http://www.abc.co.uk/thanks.php[/url]) and the payment window is closed.

Pop-up blockers are causing problems here but even when pop-up blockers are disabled, the confirmation page loads in a new window.

I’m using :

<script language=”JavaScript”>
<!–
window.opener.location=”<?php echo ($main_url);?>thanks.php>”;
window.close();
–>
</script>

I’ve tried as a test:

<a href=”#” onclick=”window.opener.location.href ='<?php echo ($main_url);?>thanks.php?’; window.close(); “>Click HERE</a>

But the page always loads in a new window and not the parent window.

Is there any way to load the confirmation page in the parent window?

Help appreciated, thanks.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@dac96authorJun 09.2009 — Hoping there's someone out there than can lead me in the right direction...
Copy linkTweet thisAlerts:
@criterion9Jun 09.2009 — You might want to look into alternative ways to "open new windows" such as a JavaScript div that can be populated using an Ajax call. Opening windows has been far over abused over the years and browser developers have started fighting back.
Copy linkTweet thisAlerts:
@dac96authorJun 09.2009 — You might want to look into alternative ways to "open new windows" such as a JavaScript div that can be populated using an Ajax call. Opening windows has been far over abused over the years and browser developers have started fighting back.[/QUOTE]

Thanks for the reply. Would this approach allow entry of credit card details over https and allow passing the user back to a http url where the cookie could be picked up on the confirmation page?
Copy linkTweet thisAlerts:
@criterion9Jun 09.2009 — Yes. Just instead of opening in a new window you just change the page to the login page and redirect back after a successful login.
×

Success!

Help @dac96 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...