Opening modal dialog window is not working in Chrome - javascript

Response To:
Opening Popup Window is not working in firefox and google chrome
Hi,I have similar code in above question.My code works fine in IE.
this.parent.window.showModalDialog('Counter.aspx', '',
'dialogHeight:170px;dialogWidth:150px;status:no;scroll:no;edge:sunken;toolbar:0;center:on;help:off;unadorned:yes;');
What can i do about this code in order to open this window in Google Chrome browser ?
Thanks for any assistance
Myra

showModalDialog works in chrome(its not truly modal though). the problem could be that it is blocking them. Chrome's minimalistic design doesnt even tell you that some times. try adding an exception for you current website.
you can find it under -
Options->Under The Hood Tab-> Content Settings Button -> Popups Tab -> Exceptions button

Related

Close current Tab using javascript for multiple browsers(Chrome,IE,Firefox)

I have Exit button in my page, when ever i clicked on that button,current browser tab should be closed.I wrote below code this is working in IE browser only but it needs to work in Chrome and Firefox.
Please help me.
Code:
window.top.close();
You can't do that in other browsers. If you check the console you will see:
Scripts may close only the windows that were opened by it

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

Chrome does not seem to allow for window.print()

I've been trying to get a simple "print" link on my recent page to work. I set up a simple fiddle to show what I'm trying to do.
http://jsfiddle.net/bladnman/4Ux9U/
For some reason Chrome is complaining about:
TypeError: Property 'print' of object [object Window] is not a function
You know, this very very simple kind of thing. Been doing it for years:
Click me to Print
UPDATE #1:
Many users have reported that this is working fine for them on Chrome. I still see nothing but the error reported.
I did want to add my environment:
Version: 21.0.1180.89
OS: OSX Mountain Lion
UPDATE #2:
Big thanks to Arjen! It turns out that an extension (Better Popup Blocker) changed the DOM enough as to null out the "print" function on Window.
Thanks again everyone!
I didn't have any issues with it, but I was able to reproduce the problem you were having on Windows 7 running Chrome 21.0.1180.89 by enabling my popup blocker (I use Better Popup Blocker - Chrome Web Store) for jsfiddle.
If you are using a popup blocker, try disabling it for jsfiddle / the site you are working with.
The Adblocker chrome extension in Mojave stops window.print() as well.

iPad Safari Popup issue

On iPad Safari, there seems to be issue with popup. When a popup (opened using window.open()) is closed, it remains in minimized mode (or grid view) after closing the popup...It
does not return focus to the parent window.
I have tried using parent.opener.focus(), but still does not work.
Is this a known iPad issue OR can we fix this issue using some JS code?
Please help.
I'm not sure if this would help, but just some personal experience on this issue:
Did you try going to iPad's Setting - Safari - Block Pop-ups? Try turning off Block Pop-ups, it should work.
If it still doesn't appear, try turning on the Debug Console for the ipad and check if any error appears during the popup event.
Try using a URL for window.open to be a local / same domain url address. I think that works (without needing to turn off the popup blocker in safari ipad).

Javascript problem in Chrome and Safari

I have a Javascript image switcher on my products page. It working perfect in IE and Firefox but both Safari and Chrome fails to load the script on some pageloads. A refresh seems to fix it but when changing product page or language it crashes.
The product page
Im using Wordpress and the script is varal.org/media/imageswitcher/
Thanks!
Anton
I did not experience any issues in either Chrome or Safari for Windows on your product page. Try this in Chrome, to check if the two scripts (imageswitcherconf.js and imageswitcher.js) are being loaded:
Press Ctrl+Shift+J to open the JavaScript Console/Developer Tools window.
Click the Resources tab on the top of the window.
Enable resource tracking/script debugging if you have to.
With the JavaScript Console/Developer Tools window still open, perform an operation that would normally trigger a crash, such as switching languages.
On the left side of the window, under the Resources heading, you should see imageswitcherconf.js followed by imageswitcher.js. (For me, they appeared fourth and fifth in the list, respectively.)
If the files aren't being loaded:
Are you behind a caching proxy?
Is your browser cache clear?

Categories