Jump to content

TAB to be ACTIVE with JavaScripting


phppup

Recommended Posts

From an open browser window, I am using code to open 2 new tabs

window.open("http://www.yahoo.com");   
window.open("http://www.google.com");   

They open sequentially, leaving browser tab that has GOOGLE open, active, and visible.

Can I use JavaScript to indicate that I want the ORIGINAL tab to STILL be the ACTIVE window of focus?

Link to comment
Share on other sites

Best I can tell, there may be a couple options that work for now, but the truth is that this sort of thing is supposed to be up to the user's preferences and not controllable by the website because it's too prone to abuse.

Any particular reason you need it opened in the background?

Link to comment
Share on other sites

Toying with different ideas.  For easiest explanation, I'll explain it this way:

Let's say I have a HOMEPAGE with a button for color-swatches.  On-click, the button opens 4 new tabs that simply show the HTML color code with the entire page being that color (except for the font, obviously).  Each of the 4 would be different shades of red for the viewer to choose which is prettiest.  There is a risk of the objectivity being tainted if a viewer feels that the last page to open (in plain sight) is the "correct" choice.

So, keeping the HOMEPAGE 'on top' would eliminate that prospect.

Additionally, the HOMEPAGE might also have another button for shades of blue.

Or even form fields to be filled out, so having it ready and primed would be more advantageous.

Either way, it was just an aspect of exploration.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.