w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
hide browser back button in the button click
Try this <script type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } </script> <BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload=""> check the DEMO here. On searching, many geek suggest that this kind of behavior is not good for browser.

Categories : Javascript

Click button programmatically and show pressed animation
You can call the VisualStateManager.GoToState method before raising the event. VisualStateManager.GoToState(Button1, "Pressed", true); Button1.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); The problem with this is that animations run asynchronously so any lines of code after the event is raised will execute immediately. One way around it would be to get hold of the Storyboard that is called when GoToState is called. To do this, you can use GetVisualStateGroups var vsGroups = VisualStateManager.GetVisualStateGroups(VisualTreeHelper.GetChild(Button1, 0) as FrameworkElement); VisualStateGroup vsg = vsGroups[0] as VisualStateGroup; if (vsg!= null) { //1 may need to change based on the number of states you have //in this example, 1 represents the "Pressed" state var

Categories : C#

How do I click on this button on a web browser?
Basically, you need to get the element and then: elem.InvokeMember("onclick") See an answer to Stack Overflow question Auto login form with Visual Basic to see guidance on how to find your element. If you need to get the JavaScript attribute to determine which is your element, get the "onclick" attribute as specified in an answer to Stack Overflow question 'onclick' button not giving address using VB.NET: elem.DomElement.attributes("onclick").value.ToString So, to resume, you need to take all the tag elements with: Webbrowser1.Document.GetElementsByTagName("a") And then loop and determine which one is the one you need to click.

Categories : HTML

Open Browser from a button click on Widget
button = (Button)findViewById(R.id.xxxx); button.setOnClickListener(View.OnClickListener){ public void onClick(){ String url = "http://www.example.com"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); } }

Categories : Android

How to find an element post button click - Web browser vb.net
Have you tried using a different attribute to get the button? I was experiencing a similar before and it was due to the fact that their was more then one button with the field I was checking. So try looking at a different attribute or use an AND statement to check more than attribute at a time.

Categories : Vb.Net

Click a button and navigate inside an iframe of different browser
Wikipedia: Same origin policy: is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site – a combination of scheme, hostname, and port number – to access each other's methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites. Wikipedia: Cross-origin resource sharing (CORS) is a mechanism that allows Javascript on a web page to make XMLHttpRequests to another domain, not the domain the Javascript originated from. To allow cors requests, the shared content server must allow it through a combination of headers : Client (www.example.com) : ORIGIN: www.example.com Server (not www.example

Categories : Javascript

how to get the previous url when user click on back button in browser
Browser only store your history, when it is full postback, means it should not be partially postback. In your case, when replacing your content, you are doing full postback or partial postback? To replace your content if you are using jquery, then it will not redirect to your previous state(page).

Categories : Javascript

Invoking google's MAP and navigation app on button click on chrome browser
If you encode using the geo: uri scheme you should be fine. For example, I created: <a href="geo:-0.3128432,51.4645338">A GEO LINK</a> And it works fine. Demo here: http://jsbin.com/atipiw/latest

Categories : Android

Click browser back button and partial view is no longer displaed?
You can have a document.ready function in your script. This will get fired every time when you load the original view. (I checked and it gets fired even if you press the back button) $(document).ready(function() { // Check the session value from the server by sending a ajax request. // You can use the success function of the ajax request to call the get group function // If a SELECTEDGROUPNAME exists getGroup(1); });

Categories : Jquery

is there a way to open a popup box in the center of the screen when somebody click the close button on browser?
The onbeforeunload event is the only event that fires (besides the onunload event, but don't use this) before the window leaves the page. The onbeforeunload event is special because it is the only event that will automatically be fired off once the user tries to leave the page, but has the option of staying on the page if the user clicks cancel. So, to directly answer your question, if the user closes the window, hits the back button, or navigates to a new URL, you will have to use the onbeforeunload event. You can add text inside of the pop-up, but some of the default text will always stay there. You just have to return a string. Now, if the user were to click on a link that is a part of your application or tries to log out, you can anchor an event to that, which could make a window pop

Categories : Magento

Put browser full screen and refresh on button click (simulate F11) JavaScript
maybe this can help you example of full screen using the blog post Native Fullscreen JavaScript API (plus jQuery plugin)

Categories : Javascript

PHP Mail Form - Preventing resubmit when click back button in browser
EDIT (#1) Redirection methods: JS-based redirection method: You could use this in place of header('Location: page.php'); under your mail() function. It's JS-based echo("<script>window.location = 'your_page.php';</script>"); and will not throw an error even before headers. You could use an href method also. echo "<a href="your_page.php" target="_top">Click here to return to our website</a>"; TESTED Place header('Location: http://www.example.com'); underneath your: mail($recipient_email, $subject, $emailBody, $headers) ; and it will redirect with no errors. Change http://www.example.com to the site/page of your choice. I used action="<?php $_SERVER['PHP_SELF'] ?>" as action in my test form using your code. Also I suggest you change this in y

Categories : PHP

After a succesful sign-in when user click on the back button of the browser, "login" page should not appear
Add this to the LoginController (controller which is using for login) before_filter :set_cache_buster def set_cache_buster response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" end This will clear the browser history See here

Categories : Ruby On Rails

After logout,how to redirect user to login page when he/she will click back button of browser in ASP.NET MVC3
Try: if(!User.Identity.IsAuthenticated) { RedirectToAction("Index", "Home"); } and use the [Authorize] data annotation on the required actions. You should be doing something like that for all your pages that require a user to be logged in anyway. Hope it helps.

Categories : C#

Show menu when i click on button and hide that when i click anywhere on the page or button
This has partly to do with something called event propagation. Put simply, this means that click events will register not only on the clicked element, but also on any parent or ancestor elements of that element. So if you click a DIV, the event will also be registered on the BODY, because the DIV is inside the BODY. Put abstractly, if a kitchen is the scene of a crime, then the apartment that houses that kitchen is also the scene of a crime. One is inside the other. This is prevented by preventing propagation - in jQuery, by running the stopPropagation() method of the evt object that is automatically passed to your event handler. In any case, your situation can be greatly simplified. var menu = $('#menu'), but = $('#menu_button'); $(document).on('click', '*', function(evt) { evt.st

Categories : Javascript

BlackBerry 10 browser submits form using browser submit button when using preventDefault
I have worked around this by adding action="javascript:void(0);" to you form (see updated fiddle http://jsfiddle.net/e4AHZ/11/). I do not know if this is good enough but action="javascript:void(0);" is in fact part of a solution given to a similar question. <form method="post" action="javascript:void(0);"> <input type="text" name="field1" value="some msg" /> <input type="text" name="field2" value="some msg" /> <input type="submit" /> </form>

Categories : Javascript

Streaming programmatically generated audio to browser
Just have look at Media source API( under implementation). this would be what you are required. window.MediaSource = window.MediaSource || window.WebKitMediaSource; var ms = new MediaSource(); var audio = document.querySelector('audio'); audio.src = window.URL.createObjectURL(ms); ms.addEventListener('webkitsourceopen', function(e) { ... var sourceBuffer = ms.addSourceBuffer('type; codecs="codecs"'); sourceBuffer.append(oneAudioChunk); //append chunks of data .... }, false);

Categories : Javascript

Toggle browser full screen programmatically
regarding your #1 question below is what Mozilla website says: In addition, navigating to another page, changing tabs, or switching to another application (using, for example, Alt-Tab) while in fullscreen mode exits fullscreen mode as well. here is a link: Using Full Screen Mode

Categories : Asp Net Mvc

Adding and Removing Dynamic Buttons From one activity to another activity in android on click of button from previous activity button click
In the first activity's onClick send the data using Intent: intent = new Intent(this, PCode.class); intent.putExtra("EXTRA_BTN_NAME", editText.getText()); intent.putExtra("EXTRA_WHERE", where); startActivity(intent); In the new activity you should get the data with @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activty2); Intent intent = getIntent(); String btnName = intent.getStringExtra("EXTRA_BTN_NAME"); where= intent.getStringExtra("EXTRA_WHERE"); LinearLayout l1 = (LinearLayout) findViewById(R.id.layout); Intent intent1 = new Intent(context1,PCode.class); Button b = new Button(this); b.SetText(btnName); //TODO - use the "where" parameter l1.addView

Categories : Android

I just want to randomly click some button and then when I click Sum button it will show the sum
This line: unction buttonClicked(obj) { should be: function buttonClicked(obj) { As you are sending the value to the function, and not an object containing the value, this: mynum[i++] = obj.value; should be: mynum[i++] = obj; As you have numbers in the array, you shouldn't parse them. This: sumOfArray += parseInt(mynum[j++]); should be: sumOfArray += mynum[j++]; Side note: When you do use parseInt you should specify the base as the second parameter, otherwise it will parse numbers that start with a zero using base 8 instead of 10. You probably want to send a value to the function that corresponds to what the button shows, so this: button type="button" onclick="buttonClicked(2)">1</button> <button type="button" onclick="buttonClicked(3)">2</button

Categories : Javascript

in c#, how can you disable a button after the 1st click, and enable it again after you click another button?
This is pretty trivial private void ScanButtonClick(object sender, EventArgs e) { // do something (sender as Button).Enabled = false; } private void BrowseButtonClick(object sender, EventArgs e) { ScanButton.Enabled = true; }

Categories : C#

Loading files in default Internet browser programmatically
Quite obviously it cannot find the file in the current directory. Make sure the following are correct: The file is included in your project and its Copy to Output Directory property is set to Copy always or Copy if newer. Use Application.StartupPath to make sure you are pointing to correct directory, so the first line would become: Code: var myFile = Path.Combine(Application.StartupPath, "html_file.html");

Categories : C#

How can I programmatically open the default browser and pass a URL in C/Linux?
xdg-open is your best choice. xdg-open http://www.stackoverflow.com You will have to watch out - check to see if it is installed before trying to execute it, as not all users may have xdg-open on their machine.

Categories : C

Javascript - Programmatically trigger the onChange event of a checkBox for any browser
Your for loop is wrong. checkboxes will be a NodeList, and you cannot for(in) over that (unless you are interested in property names). Use a regular for (var i = 0; i < checkboxes.length; ++i) checkboxes[i]... loop.

Categories : Javascript

How to hide an extension's Browser Action icon programmatically in a popup.html?
Currently it's not possible to programatically hide the browser action button. There's a feature request to implement this feature through the chrome.management API, star it at https://code.google.com/p/chromium/issues/detail?id=260281 if you want to get notified of updates.

Categories : Javascript

click on button in listItem does not respond on first click, but response on second click, how to set to response on first click?
Because you are setting your onClickListener() for your ImageViews within your ListView onItemClickListener(). So the user selects an item in your list, and only then does an onClickListener for your ImageViews get assigned. So the second time, the onclick listener of the ImageView gets successfully fired. To navigate around this issue, assign the individual ImageView onClickListeners within a custom adapter so they are assigned when they come into view as opposed to when a user clicks an item in list.

Categories : Android

Is it posible to change default search engine from Google.com to some other programmatically for Android browser
I am sorry, but I thing you will not be able to do so. Please go through this I think it might help you.

Categories : Android

jQuery click on button will show the div and again click on any area of the page will hide the div?
add this to your script inside document.ready function. jQuery("body").click(function(e){ //or jQuery(document) if(e.target.className !== "profile") { jQuery('div.account-info-box').hide(); } }); final code.(updated) <script type="text/javascript"> jQuery(document).ready(function() { jQuery('div.account-info-box').hide(); jQuery('a.profile').click(function(event){ event.preventDefault(); jQuery('div.account-info-box').show(); }); jQuery("body").click(function(e){ //or jQuery(document) if(e.target.className !== "profile") { jQuery('div.account-info-box').hide(); } }); }); </script>

Categories : Jquery

Sencha Touch button click slower than list item click?
I think is because of the pressedDelay config, which for Ext.Button default is 0 and for Ext.DataView is 100 ms. Aditionally, the button fires directly the handler function. And the dataView executes store.getAt(index) to find the record object and pass it to the itemTap callback what adds some ms.

Categories : Javascript

Not able to fire click event programmatically
Rather then using a MouseListener to monitor changes to the tabbed state, you should be attaching ChangeListener to the selection model. This way it won't matter how the tab is changed.

Categories : Java

Programmatically invoke click on JLabel
The Robot can be made to click anywhere, so yes it's possible. Check the Robot API and in particular the mouseMove(...), mousePress(...) and mouseRelease(...). You would need to get the JLabel's screen coordinates first, but this is easily done via its getLocationOnScreen() and its getSize() method. I'm curious as to your motivation for this.

Categories : Java

Defining a click event programmatically
var anch = $('<a />', { 'href': '#' + ctrlid, 'text': text }).click(function () { // click handler code }); DEMO

Categories : Javascript

Click Event on UIImageView programmatically in ios
Simply add a UITapGesture on the image but remember to make its UserInteraction Enabled. UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)]; [preArrowImage addGestureRecognizer:singleTap]; [preArrowImage setMultipleTouchEnabled:YES]; [preArrowImage setUserInteractionEnabled:YES];

Categories : Iphone

ScriptManager.RegisterStartupScript On Button Click (within updatepanel) Does not fire on FIRST click
If you are working with AJAX UpdatePanel, following code should work for you. In my case, I was using update panel and none of the about worked except this one. ScriptManager.RegisterStartupScript(myUpdatePanelID, myUpdatePanelID.GetType(), "myFunction", "myFunction();", true);

Categories : C#

Programmatically Disable Highlight on Click of UIButton
Make your UIButton a custom button and then apply a UIImage background to it. It won't highlight or change when pressed UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

Categories : IOS

How to add right click menu in eclipse plugin programmatically
I'm kind of taking a stab at this ... but why don't you assign the menu an id and use the find(id) method in the MenuManager?

Categories : Java

How to Add Click Listener to Programmatically Added Tabcontrol
I assume that your tabSearchresults is your TabPage. So first create a function which will be handler of Click event Private Sub tabSearchresults_Click(sender as Object, e as EventArgs) 'your code ... End Sub Then after line where you initialize your TabPage add this handler: tabSearchresults = New TabPage() AddHandler tabSearchresults.Click, AddressOf tabSearchresults_Click

Categories : Vb.Net

Script button click behaving not like user click
Could you please share how you tried to click the button using UiAutomator. Below code should work UiObject buttonToClick = new UiObject(new UiSelector ().text(Play).className("android.widget.Button")); buttonToClick.clickAndWaitForNewWindow();

Categories : Android

jquery hide right click menu after click on button
You should add and event handler for click events on dropdown-menu panel buttons, like this: function showMenu(menuClass) { var menu = $(menuClass); $('#demo-container').bind("contextmenu", function (event) { event.preventDefault(); menu.appendTo("body").css({ top: event.pageY + "px", left: event.pageX + "px" }).show(); }) } $(document).ready(function(){ var page = $(this); page.on("click",'.dropdown-menu button', function (event){ var button = $(this); button.closest('.dropdown-menu').hide(); }); })

Categories : Jquery

Disable mouse click on button click and enabling it again
I want to disable mouse left click on button What about the space bar? Enter? Right mouse button for left-handed mouse? Your solution Y ("Disable left click") to problem X ("User may not 'click' button") is wrong, see XY Problem. You just want to set the button's Enabled property to false.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.