Jump to content

Change then focus in browser tabs

Recommended Posts

Hello,I'm trying to run a js that will open a child window, or if the window is already open, change the focus to that window. Here is the script:

//use this one in Shoppingfunction openDes() { 	if (window.opener && !window.opener.closed) {							// if the opener is closed			window.opener.focus();									   // change the focus to the opener: does not work in tabs: domainsecurity issue (?)		} else {			window.open('http://designer.kaneva.com/', 'designer');			    // open designer in a new window			}	}	

the script works perfect if the pages are open in 2 different windows. However if the pages are open in tabs i can't change focus or even close one of the pages. the pages are sitting in 2 sub domains:http://shop.kaneva.com/andhttp://designer.kaneva.com/is there a way to change the focus to the opener when tabs are being used? Thank you,Dave

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...