popup

Alert handling in Selenium WebDriver (selenium 2) with Java

一笑奈何 提交于 2020-01-18 03:24:39
问题 I want to detect whether an alert is popped up or not. Currently I am using the following code: try { Alert alert = webDriver.switchTo().alert(); // check if alert exists // TODO find better way alert.getText(); // alert handling log().info("Alert detected: {}" + alert.getText()); alert.accept(); } catch (Exception e) { } The problem is that if there is no alert on the current state of the web page, it waits for a specific amount of time until the timeout is reached, then throws an exception

Can't use multiple modal popup

和自甴很熟 提交于 2020-01-17 06:52:14
问题 // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user

Popups in XBAP stop receiving anything but mouse events after losing focus?

烂漫一生 提交于 2020-01-17 01:18:38
问题 I have a Popup control in my XBAP, and whenever the popup control is open and it loses focus (such as an alert box, a breakpoint, switching to another application in Windows, switching to another Tab in my web browser, etc), the Popup no longer responds to anything but Mouse events. I cannot: Select a TextBox with the Mouse Highlight Text in a TextBox with the Mouse Use the Tab key to change controls Select a ComboBox item using the Keyboard when I open it with the Mouse I can: Change a

How to set title in window popup when URL points to a PDF file?

☆樱花仙子☆ 提交于 2020-01-16 20:18:45
问题 In javascript I create a URL which points to a PDF and open a new window. The window title contains the URL which I would like to hide from the user. I tried the following suggestion Set title in the window popup but this doesn't seem to work for PDFs. Is there a way to solve this problem? 回答1: You cannot hide the URL that way, but you can create a popup window with custom content and embed the PDF file inside, instead of directly linking to the PDF file. Like: <html> <head> <title>This is

How to set title in window popup when URL points to a PDF file?

不羁岁月 提交于 2020-01-16 20:18:34
问题 In javascript I create a URL which points to a PDF and open a new window. The window title contains the URL which I would like to hide from the user. I tried the following suggestion Set title in the window popup but this doesn't seem to work for PDFs. Is there a way to solve this problem? 回答1: You cannot hide the URL that way, but you can create a popup window with custom content and embed the PDF file inside, instead of directly linking to the PDF file. Like: <html> <head> <title>This is

PopUp not sending data in database in ASP.NET MVC 5 and Entity Framework

和自甴很熟 提交于 2020-01-16 10:09:12
问题 The popup code works just fine but after I add the credentials and click on the submit button to create the record nothing happens. I'm new to ASP.NET MVC 5 and Entity Framework 6. Any guidance will be most appreciated. @model IEnumerable <LogInTest1.Models.Credentials> @{var createModel = new LogInTest1.Models.Credentials();} @* I think I didn't do this part right *@ @{ ViewBag.Title = "Index"; } Here is the button code: <button class="btn btn-default" onclick="AddData()">Click to Create »<

Updating the page view after closing the modal window (Vaadin 8)

房东的猫 提交于 2020-01-16 08:38:10
问题 I use Vaadin version 8.9.3. I need to show a modal window when I click a button. In this window, the user enters the information, clicks on the button, the information is saved and displayed in a table in the main window. Main page: Modal page: To display the modal window I use BrowserWindowOpener. In order not to overload the question, I will give only a small piece of code. The FormLayout in which there is TextField("uid"), Grid and Button("Создать") - DeviceForm: private

Add Cookie to Fancy Box Popup

試著忘記壹切 提交于 2020-01-16 02:49:15
问题 I have this POPUP I can use to popup constantly - I wanted to add a 7 day cookie to it? Is that possible with what I have? <script type="text/javascript"> jQuery(document).ready(function() { $.fancybox( '<h2>' + {{ settings.popup_title | json }} + '</h2><p>' + {{ settings.popup_content | json }} + '</p>', { 'autoDimensions' : false, 'width' : 450, 'height' : 'auto', 'transitionIn' : 'none', 'transitionOut' : 'none' } ); }); </script> 回答1: Based on this answer, you can tweak the code with what

Window.open function allowing to resize the widow after setting the resizable property as “0”

北战南征 提交于 2020-01-16 01:17:32
问题 When I try to call a URL as a pop-up window through JavaScript, after loading the pop-up window I am able to re-size the window by mouse dragging even after I set the resizable property as "0". Code: <script type="text/javascript"> function poponload() { mywindow = window.open("factory.php?content=con1", "mywindow", "location=1,status=1,scrollbars=0,width=300,height=300,resizable=0"); mywindow.moveTo(150, 150); } </script> Please clarify if I made any mistake in the code. 回答1: Modern day

How to check if jQM popup fits user's viewport?

此生再无相见时 提交于 2020-01-15 16:47:55
问题 So I've managed to add scrollbars to large jQM popups with css('overflow-y', 'scroll'). But how to do this only when the popup is larger than the user's viewport? I'm trying with the jquery-visible plugin but I can't get it to respond: http://jsfiddle.net/mmRnq/124/ $('#test-button').on('click', function(e) { $('#confirmDialog').popup('open'); // https://stackoverflow.com/questions/20791374/jquery-check-if-element-is-visible-in-viewport if(!$('#confirmDialog').visible(true)) { alert('Popup