popup

Display confirmation popup with JavaScript upon clicking on a link

烈酒焚心 提交于 2019-12-19 14:50:03
问题 How do I make one of those hyperlinks where when you click it, it will display a popup asking "are you sure?" <INPUT TYPE="Button" NAME="confirm" VALUE="???" onClick="message()"> I already have a message() function working. I just need to know what the input type for a hyperlink would be. 回答1: <a href="http://somewhere_else" onclick="return confirm()"> When the user clicks the link, the confirm function will be called. If the confirm function returns false , the link traversal is cancelled,

Post a Form to Popup window not to the parent

无人久伴 提交于 2019-12-19 12:04:22
问题 I want to post a forma poupup window. Problem is, the form posts successfully but It also posts on the parent window. I want to submit the formonly in popup window '<input type= button value ="Submit Form" onclick="adNetworkForm()" > <script> function adNetworkForm(){ targetUrl = "http://somesite.com" var myForm = document.createElement('form'); myForm.method = 'post'; //myForm.action = targetUrl; var inpt1 = document.createElement('input'); inpt1.setAttribute('name','a'); inpt1.setAttribute(

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

寵の児 提交于 2019-12-19 10:46:06
问题 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");

GCM IntentService how to display a pop up on notification receive

蓝咒 提交于 2019-12-19 10:41:09
问题 I would like to, on receive of a GCM, display a Popup on my current Activity if my app is active. I wanted to access my current activity in GcmIntentService but I dont think it is possible or a good way to proceed... Can anyone help me? Solution In my GcmIntentService.java : @Override protected void onHandleIntent(Intent intent) { ... Intent broadCastIntent = new Intent("client_notifications_broadcast"); broadCastIntent.putExtra("data", extras.getString("other")); LocalBroadcastManager

Javascript confirm message problem

自作多情 提交于 2019-12-19 10:04:02
问题 I have a popup confirm box which i am able to show like below. But i dont know if the user clicked ok or cancel. ScriptManager.RegisterStartupScript(this, this.GetType(), "ajax", "<script language='javascript'>confirm('Do u wanna change?');</script>", false); so what i want to do is like this. if (orignalId != newId) { ScriptManager.RegisterStartupScript(this, this.GetType(), "ajax", "<script language='javascript'>confirm('Do u wanna change?');</script>", false); If (user clicks Yes) { add

Javascript - Confirmation when leaving page

 ̄綄美尐妖づ 提交于 2019-12-19 09:49:42
问题 I'm trying to implement a basic popup window that asks the user if they really want to leave a page, similar to what would happen on this site if I tried to close the window half way through writing this message. I realise this is something that is generally frowned upon but I have good reason for wanting to do it. I have got it working by using the following code: function confirm_exit(e) { if(!e) e = window.event; e.cancelBubble = true; e.returnValue = 'Are you sure you want to leave?'; if

How to handle popup window using selenium webdriver with Java

杀马特。学长 韩版系。学妹 提交于 2019-12-19 09:26:51
问题 Please help, I'm new in Selenium. I try to automate eCommerce website and I have problem to handle popup window. Here is the scenario: Go to http://www.lampsplus.com Click on Sale link in the header section. Click on the 1st item/product displayed on the page. (This will show the product page). On the product page, click on the red Add To Cart button. (This will add a product to cart and display a popup). On the popup, click the dark-grey Continue Shopping button. (This will close the popup.)

Open pop up/external site link in current webview

爷,独闯天下 提交于 2019-12-19 09:09:45
问题 I am currently writing a webview, it first loads a twitter page (say, NHL, http://twitter.com/nhl) as you can see, you can find the tweet for NHL, and each NHL tweet has another link for user to click, e.g. bit.ly/ujcNZo in my webview, if i click that link (i.e. bit.ly/ujcNZo), my webview, after 1 second, doesn't display anything but a twitter icon on a white color background, it should load the content but it didn't. after some time of investigation, i think it has to do with the fact that

Popup box on page exit

孤人 提交于 2019-12-19 07:49:29
问题 What I am trying to do is make a pop-up box any time a page exits or is navigated away from. Right now I have <script type="text/javascript"> function box() { var r=confirm("Message"); if (r==true) { window.location.href="yes.html"; } else { window.location.href="no.html"; } } </script> <body onunload="box();"> I have 2 problems with this: It only shows the box if you actually navigate away from the page, refresh, new url etc. If you exit the tab or browser, the box doesnt pop up. No matter

Dismiss “Confirm Navigation” popup with Watir

无人久伴 提交于 2019-12-19 06:24:10
问题 I am trying to dismiss "Confirm Navigation" popup. This is how it looks like in Chrome. To see the popup: require "watir-webdriver" browser = Watir::Browser.new browser.goto "http://www.gravityforms.com/demo/wp-admin/admin.php?page=gf_new_form" browser.text_field(:id => "user_login").set "demo" browser.text_field(:id => "user_pass").set "demo" browser.button(:id => "wp-submit").click browser.refresh At the moment I override onbeforeunload when I visit the page, as suggested at http:/