Open new window in IE8 instead of new tab


d='javascript:if(document.getElementsByTagName("*").length>0&&document.getElementsByTagName("body")[0].innerHTML!=""&&!confirm("You are about to navigate to home page Do you want to do that ? ")){opener.display2WindowHelp();}else{window.location.replace("${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}'+d+'");}';

b= window.open(d,"_spor_window_"+a+window.location.hostname.replace(/\\./g,""),"menubar=no,scrollbars=yes,height="+screen.availHeight+",width="+screen.availWidth+",left=0,top=0,resizable=yes,toolbar=no,location=no,status=no");

I wrote the above code to open a new window from home window . but its opening a new tab in IE8 . Is there a way to modify this to open a new window instead of new tab in IE8

The only guaranteed way is to change the web browser’s new window settings, which can only be done by the person using the web browser.

It is possible to open in a new window by specifying a width/height for the window, but there’s no guarantee all web browsers will behave that way.

I agree but a different code is opening a new browser window in the same browser but this is not able to do that … i think i can modify my code to do so …thanks

As a web surfer I find it very annoying when some website wants to open a new window in general. I consider it very spammy and think x2 about visiting sites like that again.

New tabs however, I’m ok with. I’d suggest you just stick with new tab.

Where new web pages open is completely under the control of your visitor. The days when the web page author could force pages to open in a new window ended long before browsers introduced tabs - that’s why no option for opening a new tab was introduced into JavaScript.

it still works in IE8 i guess the problem is with the javascript that i assigned to the variable if i give a url in place of script it holds good and working fine i need to figure out a way for this … any how thanks for your help

this is for internal use and we need to do this for our app thanks for ur comment.

So you need to configure each copy of the browser to always open pages that request it in a new window. Of course that will then apply to requests from all web sites and not just your internal one.