[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Force page to open in IE

I have a script that only works in IE.

Is there any way to put code in the header that if the page is opened in firefox or something else, to force a page close, but then  re-open it in IE?
0
rivkamak
Asked:
rivkamak
  • 2
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
>Is there any way to put code in the header that if the page is opened in firefox or something else
Yes : http://www.positioniseverything.net/articles/cc-plus.html

>, to force a page close
No way

>, but then  re-open it in IE?
No way
0
 
BadotzCommented:
You could lert the Poor User that the script on your page only works in IE.

window.close might pop up an alert, letting you close the window. But once closed, there is no way to automatically open IE because there is nothing to open it from. The other browser window is closed, Man ;-)

0
 
David S.Commented:
As the other experts have said, you can't do this with normal JavaScript.  You would need a browser plugin or extension to do this kind of thing.  Is there no way to modify the script to make it cross-browser compatible?


> window.close might pop up an alert, letting you close the window.

window.close() only works for windows opened via window.open().
0
 
BadotzCommented:
>>window.close() only works for windows opened via window.open().

This works in IE8:
<a href="javascript:parent.window.opener='';parent.window.close()">Close the window</a>

Open in new window

0
 
David S.Commented:
The restriction on window.close() was not present in some of the older browsers. And that hack works in at least one of them.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now