0

My scenario is like below-

I opened one page and click on one link. It redirects to me in new tab. In new tab, i perform some operations and click save button which again redirects to me on the previous page.

Now, we have page one with old and second with new data.On button click(second tab) i want to close the previous tab and refresh current tab.Every time i have one tab left over with old data.

I am working on SharePoint web part through user control in c# and it should support all major browsers also.

Thank, any help will be welcomed.

Vikas Bansal
  • 148
  • 2
  • 7

1 Answers1

1

You cannot achieve this with JavaScript due to the obvious security hazards (imagine if Facebook initiated this kind of 'wizardry' and closes all other tabs every few minutes?).

You could however initiate a worker, ajax-call or some sort of long-polling on your first tab to monitor if and when the second tab is updated, then close it. Even here applies that only the tab that is running the script can close itself, as Ryan Joy mentioned in this comment.

Community
  • 1
  • 1