Popup window to return data to parent on close

In the calling (parent) window add such JS code: function HandlePopupResult(result) { alert(“result of popup is: ” + result); } In the child window code add this: function CloseMySelf(sender) { try { window.opener.HandlePopupResult(sender.getAttribute(“result”)); } catch (err) {} window.close(); return false; } And have such links to close the popup: <a href=”#” result=”allow” onclick=”return CloseMySelf(this);”>Allow</a> <a … Read more

override css for html5 form validation/required popup

It’s impossible to change the validation style with only HTML5/CSS3. It’s part of the browser. The only attribute I figured out to change is the error message by using this example: document.getElementById(“name”).setCustomValidity(“Lorum Ipsum”); But, as shown in this example : http://jsfiddle.net/trixta/qTV3g/, you can override the panel style by using jQuery. This is not a plugin, … Read more

is it possible to open a popup with javascript and then detect when the user closes it?

If you have control over the contents of the pop-up, handle the window’s unload event there and notify the original window via the opener property, checking first whether the opener has been closed. Note this won’t always work in Opera. window.onunload = function() { var win = window.opener; if (!win.closed) { win.someFunctionToCallWhenPopUpCloses(); } }; Since … Read more

Delay pop-up for 10 seconds, only pop up once

Actually, none of the solutions posted previously work in real life, why? because the line: $(“#various1”).fancybox(); doesn’t trigger fancybox, it just binds fancybox to the selector #various1, but it still needs a click to trigger the modal/lightbox (not a popup). BTW, GearĂ³id’s solution has syntax errors anyway. The only real value is that they suggest … Read more

How to handle login pop up window using Selenium WebDriver?

Use the approach where you send username and password in URL Request: http://username:[email protected] So just to make it more clear. The username is username password is password and the rest is usual URL of your test web Works for me without needing any tweaks. Sample Java code: public static final String TEST_ENVIRONMENT = “the-site.com”; private … Read more