خرید بک لینک

Vote count: 0

On my login page, there is a script that gets called when the user clicks Log In, if they have to change their password upon logging in.

This script calls window.showModalDialog or window.open depending on the browser. It directs to a page "popup_main.aspx" which redirects the window to the actual page they're trying to access, which is passed as an argument to the url, so the url looks something like this: pStrUrl = '/popup_main.aspx?Destination = ' + someValue;

In this case, someValue is ChangePW.aspx.

On that page, once they change their password I need to close this popup and redirect the main browser window to a certain page.

I've tried a handful of different methods:

opener.location.replace('http://google.com'); self.close();
window.opener.location.replace('http://google.com'); self.close();

Both of these throw an error saying that location doesn't exist on null-- so opener is null.

I tried changing it to:

window.parent.location.replace('http://google.com'); self.close();
window.parent.location.href = 'http://google.com'; self.close();

These instead opens a new popup and navigates to Google.

So how can I close a popup window and navigate its parent to a given address?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 10 فروردين 1395 ساعت: 21:20

صفحه بندی