Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open multiple tabs in Internet Explorer

Status
Not open for further replies.

bkoopers

IS-IT--Management
Apr 26, 2005
86
US
I need a script that will open multiple web pages in Internet Explorer with the last tab being the active one. I do not know the Javascript language but I found the following script that almost does what I want:

JavaScript:
var navOpenInBackgroundTab = 0x1000;
var objIE = new ActiveXObject("InternetExplorer.Application");
objIE.Navigate2("[URL unfurl="true"]http://www.google.com");[/URL]
objIE.Navigate2("[URL unfurl="true"]http://www.yahoo.com",[/URL] navOpenInBackgroundTab);
objIE.Visible = true;

If I execute the above code in a “StartIE.js” file, although the code opens google and yahoo in separate tabs in the same Internet Explorer Window, it leaves google as the active tab. I want yahoo (the 2nd tab) to be active.

The actual purpose for this is because of a strange action that is happening for a webpage that I am working with that is opened via a url with a number parameters via Oracle code. When the page loads in Internet Explorer, the url address box changes to a simplified form of the url dropping out the parameters.The Oracle code periodically issues a page refresh but it then refreshes with the url without the parameters so the page does not get displayed properly. As a workaround, I discovered that if you open the same url again in another tab, the parameters remain in the url box so it will get refreshed properly. Therefore, I need a script to open the url twice in separate tabs but have the second tab as the active tab.

What do I need to change in the above script so that the second tab (in this case, yahoo) is the active tab (not the background tab).

Thanks to anyone who can help me out.
 
You could use this but IMHO you are taking an awful approach. I know it's easy yo say without knowing the requirements but opening tabs and changing focus use to be an ugly practice.

Cheers,
Dian
 
Diancecht: Thank you for your response.

I looked at that webpage you referred to. Although a similar request is being discussed, I do not see the exact code needed there to accomplish what I need.

I am looking for a quick temporary fix to get the webpage I need periodically refreshed to display correctly so I will have time to investigate the root problem of why the url in the address box is getting truncated when the first instance of the webpage is opened.

If my approach for getting a second tab opened and having it be the active tab is awful, can you please recommend a better approach?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top