popup

Why is window.open() silently ignored iff called from within a loop and via setTimeout()?

馋奶兔 提交于 2019-12-01 12:59:50
问题 --- EDIT. I don't get it; yesterday it seemed to be ignored; now it seems to be working. Even within loop and called via setTimeout() . Currently I seem to be having difficulties replicating yesterday's behaviour... What is going on? --- 2nd EDIT. First idea how to "fix" the replication of the issue: weirdly, whether or not this works seems to be dependent on the current URL! E.g. works from SE-sites, but not from, say, http://www.asdf.com/. How so? Whereas setTimeout() works here: setTimeout

javascript - opening hidden iframe for file download on document ready

老子叫甜甜 提交于 2019-12-01 12:54:07
I’m trying to use this trick to open a file download dialog on document ready. The same trick has worked another time for me, but that time the iframe was added after an ajax call. This is the snippet: <script type="text/javascript"> $(document).ready(function() { var url='/my_file_url/'; var _iframe_dl = $('<iframe />') .attr('src', url) .hide() .appendTo('body'); }); </script> While the iframe is correctly printed in html code, it doesn’t have the expected behaviour: no download file popup appears after loading the page. Any help on why? It works just fine , assuming that the MIME is of a

javascript - opening hidden iframe for file download on document ready

谁说胖子不能爱 提交于 2019-12-01 12:21:42
问题 I’m trying to use this trick to open a file download dialog on document ready. The same trick has worked another time for me, but that time the iframe was added after an ajax call. This is the snippet: <script type="text/javascript"> $(document).ready(function() { var url='/my_file_url/'; var _iframe_dl = $('<iframe />') .attr('src', url) .hide() .appendTo('body'); }); </script> While the iframe is correctly printed in html code, it doesn’t have the expected behaviour: no download file popup

JTable right-click copy/paste menu to copy cell data on one click

拜拜、爱过 提交于 2019-12-01 12:20:56
I created my JPopupMenu . It appears on my JTable when I right click on a cell. However, I cannot copy the data in the cell unless I first double click and then highlight the data, and then right click anywhere but this current cell to show my popup menu and copy option. I would like to copy the data in a cell without having to double click on a cell and enter into cell edit mode where I then need to select the data. How can I do this? popup = new JPopupMenu(); popup.setName("popupMenu"); menuItemCopy = new JMenuItem(new DefaultEditorKit.CopyAction()); menuItemCopy.setText("Copy");

Opening an external website in a modal popup

烈酒焚心 提交于 2019-12-01 12:04:45
问题 I know that <a href="http://www.example.com" target="_blank">Click here</a> opens the link in a new tab (default behaviour in Chrome and Firefox) and that <a href="http://www.example.com" onclick="window.open('http://www.example.com', 'newwindow', 'width=700,height=500'); return false;">Click here</a> opens it in a new window. But how to open an external page in a modal popup (centered on screen, rest of the original page "darkened")? Is there a nice way to do it? I tried the following code,

Reload parent page after closing popup window

☆樱花仙子☆ 提交于 2019-12-01 11:19:13
I am trying to have the user sign in through a popup window. When they click the link to the popup window which is a php variable they can sign in. When the window closes I want it to reload the page they were originally on (the parent page). Here is the code on the signin.php page... <body onunload="opener.location=('')"> But all this does is make the sign in page become the page the user was on. I think I need to put something in the parentheses, but I can't figure out what goes there. Chris Baker To reload a page, you can set the location property as the current value, like this: window

JTree and dropdown options on right clicking nodes

巧了我就是萌 提交于 2019-12-01 10:40:11
I'm trying to use the JTree and implement different drop downs for all the parent nodes and the children nodes. Here's what I've done: pmTree.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { try { if(evt.getButton() == evt.BUTTON1) { } else if (evt.getButton() == evt.BUTTON3) { TreePopup(evt); //pmTree.updateUI(); } }catch (Exception e) {} } }); and PopupCode: public void TreePopup(java.awt.event.MouseEvent evt) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) pmTree.getLastSelectedPathComponent(); popup = new

Modify the “options” parameter of popupbeforeposition event

匆匆过客 提交于 2019-12-01 10:38:02
I am using the Popup widget of the jQuery Mobile library (version 1.3.1). I am trying to handle some code in the beforeposition event. The documentation says that: Handling this event gives an opportunity to modify the content of the popup before it appears on the screen. For example, the content can be scaled or parts of it can be hidden or removed if it is too wide or too tall. You can also modify the options parameter to affect the popup's placement . The properties inside the options object available for modification are the same as those used by the reposition method. I need to set the x

Chrome Extension won't load my JavaScript from the popup file

六眼飞鱼酱① 提交于 2019-12-01 10:33:22
I'm working on building a Chrome extension for a forum, but the problem is the JavaScript for my popup.html won't do anything. I added alert("popup.js running...") at the top and it does come up but then my popup doesn't display at all. This is a problem because JavaScript is going to be required for the popup page. I'm kind of lost, so I'm assuming I'm just missing something that is preventing my JavaScript from running. I heard the AdBlock extension would prevent it from running but I removed that and it still didn't work. Anyone see a problem? manifest.json { "name": "Riggy", "short_name":

How to check for webpages' popups?

帅比萌擦擦* 提交于 2019-12-01 09:48:55
问题 Is there a possibility if I code a program in python that allows to automatically browse a given website using mechanize to detect if there are popup windows (suggesting advertisements or downloading actions ...) using Python ?. I would appreciate any hint (for example, if you give me a library that fulfills this task I would be very happy) 回答1: Mechanize cannot handle javascript and popup windows: How do I use Mechanize to process JavaScript? Mechanize and Javascript To accomplish the goal,