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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open - vbscript vs javascript

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I need to display a dull 'terms and conditions' page on a web site. This page has to be available via a link so that visitors can sift through the detail if they really want to but not necessarily lose sight of the main page of interest. Most pages on the web appear to open a separate browser window for this kind of thing so it seemed a sensible way to go but....

Using window.open in vbscript appears to activate pop-up blocking while the equivalent in javascript appears OK.

Could I be doing something dumb in VbScript or is there, as it appears, a distinct advantage to using the javascript version. Could it be a matter of time before this approach is blocked completely?

I am using Windows XP SP2 & IE6.

Thanks in advance.

 
VBScript only works in IE, so anything you write using that language will

If you're going to ask questions here about code you've written, you HAVE to show what you have. We can't read the stuff telepathically, you know.

Lee
 
I'm aware of telepathic incompetence [smile] of most contributors. I was just wondering whether there was a fundamental difference between the way the two are treated for script blocking.

My javascript looks like:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenInNewWindow(URL) {
  NewWindow=window.open (URL, "myWindowOne", "toolbar=no, menubar=no, width=550, height=550, scrollbars=yes, resizable=yes");
}
//-->
</SCRIPT>

<a href="javascript:OpenInNewWindow('STKeyFacts.htm');">More details...</a>
The Vbscript was
Code:
<SCRIPT LANGUAGE="VbScript">
function OpenNewWindow()
  set NewWindow=window.open ("STKeyFacts.htm", "myWindowOne", "toolbar=no, menubar=no, width=550, height=550, scrollbars=yes, resizable=yes")
end function
</SCRIPT>

<a href="vbscript:OpenNewWindow()">More details...</a>

The vbscript results in a message 'a pop-up window was blocked message' in the status line at the bottom of IE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top