WIndow.open in Javascript - javascript

I really need your help. I am working on a pop up window
using JavaScript.
I am using the window.open(URL,name, properties);
I wanted to load a window that does not load the URL window.
I tried the location=0 and location=no setting, it seems to work
fin on Firefox but alas it is not working on IE!
In Firefox, it is not showing the location bar anymore, but in IE
the location bar is still there with the URL!
Please help. :9
tinks~

You seem to be calling the method correctly, IE most likely doesnt allow you to hide its url bar. Most browsers have user-defined preferences whether they want to allow websites to be able to hide toolbars. Popups are very susceptible to security options.
I'm afraid you'd have to live with it, if the user doesnt want you to hide the url it wont.

Not possible anymore as all modern browsers do not allow you to hide the URL in Popups anymore :)

Related

Opening browser's home page in other than IIE

I'm writing a bit of code to display an EU Cookie notification.
If the visitor does not accept the use of cookies, I want to take them somewhere else. My first thought was to take them to the browser's home page.
I found a way to do it in IE - I have been told that the method on that page is for IE 10 or less.
I have not found a way to do so in other browsers.
If this turns out to be more trouble than it is worth, I'll take them somewhere via a specific URL, such as www.google.com
Does anyone know of the method to accomplish the same thing in browsers such as Firefox, Safari, Chrome, etc?
Most browsers implement an address that will point to the home page. You should be able to redirect the user to the proper location after you figure out their browser.
For Chrome you can link them to about:newtab, which may be different from the home page, but it is probably the closest you will find. The actual homepage button is not implemented in Javascript and does not use a URL.
For Firefox you can link to about:home.
For Opera you can link to opera:speeddial. (I did not test this one, if someone wants to I'll update)
The documentation you linked to claims to be obsolete after IE10. I think you can link to about:home on IE same as Firefox if your solution isn't working afer IE10. (I did not test this one, if someone wants to I'll update).

The IE doesn't show address bar for popup

I am on the parent page from which I use javascript in jsp, to open a popup and I used the method window.open("url","windowName"," width,height,locastionx, locationy") to get a popup. Everything works fine in all browsers(like Mozilla, Chrome etc) except that the Popup doesn't show the url or address bar in Internet Explorer 10.
I am attaching the screenshots for reference
The following screenshot is a popup from IE
The following is a screenshot of popup from Mozilla
Is there a way in which the window.open method which will show address bar in the IE?
Thanks for helping
I did read in few online blogs that the behaviour of the popup is different with the IE7 or above than in the Mozilla or the Chrome browsers.
I've been busting my head around this problem a couple of days, I've browsed a lot of sites to find the answer, finally I discovered that IE when you run your code in a local environment it hides the URL bar, but when I run it in a Test/Prod server the address is shown (not showing the URL address is clearly a security flaw), this just happens only in IE, which is annoying, for FireFox and Chrome work as intended, and it's kind of a headache if you need to test because it may seem like an error or bug.
Here are the links that should make the things clearer:
Complete cross-browser window.open() documentation -> here
MSDN open method notes ->
here
Server Fault question about IE trust policies related to the URL bar -> here

Remove Address bar from popup window using Javascript

Is it applicable to remove the address bar from a popup window using javascript
ex:
window.open(url, 'liveMatches', 'width=720,height=800,toolbar=0,location=0, directories=0, status=0, menubar=0');
please advice,
use jquery ui (http://jqueryui.com/demos/dialog/)
or perhaps
window.open(url,'liveMatches','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=800');
actually
You cannot remove the address bar in modern browsers. That is a security measure. The user must always know what page they are on. Address bar also let user know, what type of security is on that page (HTTP or HTTPS).
Theoretically, yes. However, as with everything in Javascript, there's no guarantee that any given browser will support it or that the implementation will be consistent across browsers.
This link as well as this link indicate that the location option should control whether or not the Location/Address bar is shown. It should also have relatively good cross-browser support.

Window.open opening tab instead of popup in Opera?

I'm simply opening a popup from JavaScript with the settings you can see in the code. Works fine in Firefox. In Opera it's opening it in a new tab instead. Why?
Here's a JSFiddle:
http://jsfiddle.net/hafWs/3/
The number of parameters doesn't seem to make a difference. Either work in Firefox and IE8. (Don't have IE9 or Chrome to test right now.)
I tried googling... can't find anything. I don't even see anything here that mentions it, yet it's clearly working in their examples: http://www.quirksmode.org/js/popup.html
Thank you for any help.
There is problem with spaces in options param:
window.showPopup = function(){
window.open(
'http://placekitten.com/600/500',
'thePopup',
'width=600,height=500' /* <------- Look, no spaces and works */
);
}
It is still a tab, but with different dimensions. So, it looks kinda as popup.
This is controlled by the browser itself (preferences) and cannot be changed from JavaScript.
NOTE: I've seen some posts that say you can determine whether the window opens in a tab or as a new window based on the parameters that you pass the window.open function. I have never seen this work consistently.

Javascript window.open not focusing in Windows7

I'm using IE8 in Windows7. When in Javascript I do window.open(....), the new window starts blinking in the taskbar. I want the new window to be displayed to the user and not hide in the taskbar.
I've tried:
var myWindow = window.open(.....);
myWindow.focus();
But still it starts blinking in the taskbar. Anyone knows the trick to fix this?
If there were a way to do what you want to do, every popup ad in the world would use it and the web would be a worse place. so there isn't a way to do it. =)
You might have better luck if the window.open occurs in a click handler or something like it - there are complicated heuristics baked into the browser around allowing poups if they're deemed 'intentional'.
I actually got this working. Initially I was opening IE8 using the IE icon on the task bar menu. For some reason I then decided to open IE directly from C:/Program Files/Internet Explorer/ and it worked as expected.

Categories