w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Parent Page Load Event fires every time a User Control Event Fires
This is how the ASP.NET WebForms page life-cycle works. Controls that postback will cause the host (read: parent) page to go through its Page_Load. If you do not like this model, then you should consider ASP.NET MVC or a client-side solution where you can make AJAX calls to acquire data and then do client-side rendering via templating logic.

Categories : Asp Net

C# windows forms listbox selected index changed event fires on form load and button click
Since you set the datasource of lstResults it will call SelectedIndexChanged, you can do as below private void btnSearch_Click(object sender, EventArgs e) { //Remove the handler this.lstResults.SelectedIndexChanged -= lstResults_SelectedIndexChanged; // // Your code // this.lstResults.SelectedIndexChanged += lstResults_SelectedIndexChanged; // Add the handler }

Categories : C#

Mobile Browser fires click/tap event twice
I had the same problem. My solution was to add return false; at the end of the event-handler. Example: $(document).on("click, tap", ".autoTeam", function(event){ // do thing return false; // double event fix });

Categories : Android

Button click event fires on page reload
() brackets call to function execute remove them or use this: var submit_button = document.getElementById('form_submit'); submit_button.addEventListener("click", function(){test_click_event();}); function test_click_event() { alert("Button clicked"); } Demo

Categories : Javascript

Panel item listener of click event only fires once
I simply reset the form after the event handling logic executes likeso: 'select': function(combo, selection) { console.log('you there?'); var building = selection[0]; if (building) { retrieveBuildingInfo(Ext.String.format(env_url + 'building.php?id={0}', building.get('id'))); } this.reset(); }, I am not sure if it is the best way to do it but it works

Categories : Extjs

jQuery onblur event fires on load instead of on blur when using ajax in wordpress front end
I don't know what are your requirements but I assume this ajax call shouldn't happen even when the field is empty so just try put an condition if(jQuery("#jw_email").val() != ''){ jQuery(this).on("blur", function(){ var jw_email = $(this).val(); jQuery.post( // see tip #1 for how we declare global javascript variables MyAjax.ajaxurl, { // here we declare the parameters to send along with the request // this means the following action hooks will be fired: // wp_ajax_nopriv_myajax-submit and wp_ajax_myajax-submit action : 'rcv-checkuser', // other parameters can be added along with "action" jw_email : jw_email, postCommentNonce : MyAjax.postCommentNonce }, func

Categories : Wordpress

Should I attach my .on('click') event to the document or element
It depends. You can attach handler to any element you want, of course, and in some cases you will have to attach it to document or body (if you, for example, want to target all the links on the page). But, if you are sure that certain elements will always appear only inside given element (which is already created) - then for performance sake, you can attach event handler to that common parent.

Categories : Javascript

JQuery form click function loads before document load
This is caused by the script above running before the DOM is built. Since you are using jquery you should move this code inside the ready method. This will ensure the DOM is ready before executing the click event. From jquery docs... $(document).ready(function() { // Handler for .ready() called. }); or the shorthand version... $(function() { // Handler for .ready() called. }); Refer to http://api.jquery.com/ready/ for more information.

Categories : Jquery

Creating on popupmenu on a right-click(contextmenu) event on a document not working as expected
Your code works fine for me (at least the part which you shared). It reacts to the first and every other right click and never reacts to left click. But you can make the element to react to right click by supplying true as the opt_contextMenu parameter of the attach method, such as like this: popupMenu.attach(element, goog.positioning.Corner.TOP_LEFT, goog.positioning.Corner.BOTTOM_LEFT, true);

Categories : Javascript

how to load different div's onto a same div on click event
Try to use this example $(function(){ $('#structure').click(function(){ $('#div1').html($('<div>', {'text' : 'structure'})); }); $('#style').click(function(){ $('#div1').html($('<div>', {'text' : 'style'})); }); }); Update $(function(){ // load default div to div 1 $('#div1').append($('#default')); $('#structure').click(function(){ // load some div to div 1 $('#div1').append($('#divForStructure')); }); $('#style').click(function(){ // load some div to div 1 $('#div1').append($('#divForStyle')); }); });

Categories : PHP

How to run the event load on click?
You mean button clicked -> load Person HTML <div id="btn">Button</div> Javascript Ext.define('Person', { extend: 'Ext.data.Model', fields: ['id', 'name'], proxy: { type: 'ajax', api: { read: '/someurl' }, reader: { type: 'json', root: 'data', successProperty: 'success', totalProperty: 'total' } } }); Ext.onReady(function(){ document.getElementById('btn').addEventListener('click', function(){ Person.load(1); }) });

Categories : Javascript

AS3 - MouseEvent.CLICK fires off for mouse click that happened before the listener was added
It sounds to me like the previous iteration of your game has not had the MOUSE.CLICK event listener removed. Even if the game is removed, the MOUSE.CLICK event will continue triggering whatever handler you added to it, eg; addEventListener(MOUSE.ClICK, ). When the game is removed you also need to removeEventListener(MOUSE.CLICK, ).

Categories : Actionscript

Click on dynamically added element fires 2 click events
Sharing your code will provide us more information. Anyway most of the times your events fires multiple times the problem is you are registering the same event multiple times. One aproach to avoid this, just in case you need your event be fired only one time is using "one" function instead of "on" function. Or "unbind" registered events.

Categories : Jquery

How do I load a my Java Applet on a Click event?
Don't include the regular <applet> (or <object>) tag in your HTML. Instead follow this tutorial on how to do dynamically add it to your page, using JavaScript. HTML 4 function loadApplet(code,codebase,width,height,alt){ var placeholder=document.getElementById('placeholder'); if(window.opera){ placeholder.innerHTML='<applet code="'+code+'" codebase="'+codebase+'" width="'+width+'" height="'+height+'" alt="'+alt+'"></applet>'; }else{ var a=document.createElement('applet'); a.setAttribute('code',code); a.setAttribute('codebase',codebase); a.setAttribute('width',width); a.setAttribute('height',height); a.setAttribute('alt',alt); placeholder.appendChild(a); } } HTML 5 function loadApple

Categories : Java

how to load marker on button click event
var geocoder = new google.maps.Geocoder(); function geocodePosition(pos) { geocoder.geocode({ latLng: pos }, function(responses) { if (responses && responses.length > 0) { } }); } function updateMarkerPosition(latLng) { document.getElementById('info').innerHTML = [ latLng.lat(), latLng.lng() ].join(', '); } function initialize() { var latLng = new google.maps.LatLng(-29.3456, 151.4346); var map = new google.maps.Map(document.getElementById('mapCanvas'), { zoom: 8, center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP }); var marker = new google.maps.Marker({ position: latLng, title: 'Position', map: null, //<-- it will be created but not shown. draggable: true }); updateMarkerPosition(latLng); g

Categories : Javascript

Tapped event fires before DoubleTapped event in WinRT
You can't do in this way because it will always fire the first event of tap. You can manage the double tap with the single tap event using a boolean or a counter to manage the following tap events.

Categories : Xaml

How to enable a click event on first colum of ng-grid on page load
You should be using delegated events for this: $(".colt0").on("click", ".icon-sort", function(event){ // will fire for dynamically loaded .icon-sorts }); Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. ... and ... In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored. Read more here.

Categories : Javascript

Un familiar error in asp.net when an event click..Failed to Load View State
I've seen this happen when javascript is modifying server-side HTML controls (runat="server") on the page prior to postback. For example, if you're modifying an asp:DropDownList's items via javascript. If you post the code of the page having issues, you may get more specific answers.

Categories : C#

fire server click event after executing a jquery ajax call from client click event
You can use jquery trigger(): EDIT: Call the CheckApp() function from OnClientClick: <asp:imagebutton id="imgbtn" runat="server" ImageUrl="/Images/icon.gif" OnClientClick="return CheckAPP();"></asp:imagebutton> And return true or false to trigger click event: function CheckAPP() { $.ajax({ type: "POST", url: "testPage.aspx/ValidateSerialNumber", data: "{strSerialNumber:'" + strSerialNumbers + "',strManufPartNo:'" + strMPartNo + "',strCountryCode:'" + '<%=strCountryCode %>' + "',strIpAddress:'" + '<%=strIpAddress.Trim %>' + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { return true; }, failure: function (msg) { retur

Categories : Jquery

AngualrJS ng-click fires twice
The code you've provided does not fire the event twice: http://jsfiddle.net/kNL6E/ (click Save) Perhaps you included Angular twice? If you do that, you'll get two alerts, demonstrated here: http://jsfiddle.net/kNL6E/1/

Categories : Javascript

What fires 'touchmove' event?
The exact implementation depends on the user agent, as can be read in the specification on here in section 5.5 the touchmove event

Categories : Javascript

transitionend event fires twice
transitionend fires for each property transitioned, in your case top and left. You can access the property associated with the event at event.originalEvent.propertyName. There's no "transitionsend" event, so you will probably need some hackiness such as filtering the transitionend callback handling for only one of the transitioned properties. E.g.: function (event) { if (event.originalEvent.propertyName == 'top') { //put your code here } }); ps. No browser fires the MSTransitionEnd event. It was at some point in the MS docs, but sometime before the IE10 beta release it was replaced by the standard transitionend event.

Categories : Javascript

Div elements on click fires for the first element only
An id is a unique identifier, you cannot have two or more things on the same page with the same identifier and expect things to work properly. Make your identifiers unique, and bind to the click event using a class selector instead.

Categories : C#

Accidentally fires click with touchend
On touchstart store the Y position of the touch event in a variable. On touchend compare the Y position of the touch event to the Y position you have stored. If the difference between both is less than X do your popup function. If the distance between both is bigger than X, that mean it's a scroll, don't do anything. Javascript var startY,endY, deltaY; $('.ImageLink')[0].addEventListener('touchstart', handleTouchStart, false); $('.ImageLink')[0].addEventListener('touchmove', handleTouchMove, false); $('.ImageLink')[0].addEventListener('touchend', handleTouchEnd, false); function handleTouchStart(e) { if (e.touches.length == 1) { var touch = e.touches[0]; startY = touch.pageY; deltaY = 0; } } function handleTouchMove(e) { if (e.touches.length == 1) {

Categories : Jquery

jquery on click only fires first time
With the drop down, when you click on an open document, it automatically closes the menu. Using the jsfiddle example you gave, removing the last two lines: $(this).closest(".dropdown-menu").dropdown('hide'); return false; allows the code to run multiple times. Removing the "return false" is just good practice because you already negated the click action with e.preventDefault();

Categories : Jquery

GWT History - onValueChange event fires twice
I figured out the problem. I was adding the new history item on the onclick of an anchor and therefore i needed to add event.getNativeEvent().preventDefault(); after the new history item was added. see code below. public void onClick(ClickEvent event) {     History.newItem(Views.home.toString());     event.getNativeEvent().preventDefault(); } i hope this can help other people.

Categories : Gwt

Socket.io: IE fires reconnecting event only once
This is how I worked around this issue for socket.io 0.9.6 / ie8: var _socket = io.connect(); ... _socket.on('disconnect', function(){ var interval = setInterval(function () { if (_socket.socket.connected) { clearInterval(interval); } else { _socket.socket.disconnect(); _socket.socket.reconnect(); } }, 31000); }); 31 seconds interval is needed for the previous jsonp script inserted into document to time out, othervise multiple connect events are triggered (multiple sockets get connected) when server becomes available..

Categories : Node Js

Know which item fires the event when observing @each
As far as I know there's no way to tell. The docs don't mention how to do this either. See here and here. It does however mention this: Note, @each.property observer is called per each add or replace of an element and it's not called with a specific enumeration item. Normally if you add a obj and keyname parameters to the observer function and call obj.get(keyname) you'll get the object you're watching. But since the keyname here is array.@each.isDirty that doesn't work. isDirtyChanged: function(obj, keyname) { obj is the targen here the object wacthing the array keyname is 'array.@each.isDirty' // Do something }.observes('array.@each.isDirty'); I'd love to be proven wrong though! Here's a fiddle try some stuff out.

Categories : Javascript

Checkbox event that fires AFTER the value has changed
You're doing this the wrong way around for WPF. Instead of looking at the UI controls, look at the data. You said that you were binding the Checkbox controls to a property of the ObservableCollection... I'm guessing that you meant a property of the object inside the ObservableCollection and not the collection itself. So in your view model or code behind, update your total value when the property that is bound to the Checkbox control is changed. This way, it will have the updated value every time.

Categories : C#

Page Load only partially fires in production
Sounds like an older DLL version is in production. Make sure to compile completely (full build). Hit Ctrl + Shift + B from Visual Studio, and upload again. While doing so, pay attention if the bin folder's files are the same size.

Categories : Asp Net

Javascript onclick fires on page load
Wrap the handler in a function like: $("li a:contains('Search')").ready(function(){ $("li a:contains('Search')").on("click", function() {replaceWithSearch($("li a:contains('Search')"))}); }); That way, the handler is defined and associated with the click event, rather than executing immediately.

Categories : Javascript

Jquery event that fires when MVC controller is finished
You might wanna try @Ajax.ActionLink instead. It has OnComplete property where you can set that jQuery function that unlocks the screen. @Ajax.ActionLink("Download FIle", "ActionName", "ControllerName", ... , new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, OnBegin = "LockScreenFunction", OnComplete = "UnlockScreenFunction", UpdateTargetId = "TargetElement" })

Categories : Jquery

Is there an event handler for an tag that fires when the page loads?
No, you can't. The easiest way to make it work would be to put the function call directly after the element <body> <a></a> <script>alert(1)</script> </bodY>

Categories : Javascript

Show popup when MouseEnter event fires
The problem is that you are setting the 'contents' parameter for getPopup(Component owner, Component contents, int x,int y) to null. This is why you are getting an IllegalArgumentException. Try changing null to something like "new JButton("TEST")" and you will see a ton of buttons popup. The contents is what you want to popup (a widget, a panel, a window, etc).

Categories : Java

ComboBox fires change event on every keypress
The reason this is happening is because it actually is changing the value every time you hit a key. What you want to use is the select listener. Using this you can grab the value out of the record that was selected. listeners: { select: function(combo, records, eOpts) { console.log(records[0].get('name')); console.log(records[0].get('abbr')); } }

Categories : Extjs

How to fire "Click" event of Checkbox using "Label Click" event in Delphi?
The Click() method merely triggers the contro's OnClick event, nothing else. It does not actually cause the control to perform click-related logic, like updating its internal state. You can toggle the CheckBox's state like this: CheckBox1.Checked := not CheckBox1.Checked; Alternatively, use an accessor class to reach protected members: type TCheckBoxAccess = class(TCheckBox) end; TCheckBoxAccess(CheckBox1).Toggle;

Categories : Delphi

load external xml in xslt 1.0 with document() function but pass url of document as variable
I think your problem is the base of a relative URI. When the argument to document() is evaluated as a string, the base URI is the stylesheet. When the argument to document() is evaluated as a node, the base URI is the base URI of the node. You've declared the variable in a way that it is getting used as a string by the document() function: as a result tree fragment. If you declare the variable using select="some_node" instead of a child xsl:value-of then that changes the data type of the argument to the document() function, which changes the base URI of the evaluation, which may change the result. Otherwise, your first line is correct: document($variable)

Categories : Xml

Partial refresh fires the addOnLoad event in XPage
When doing a partial refresh without specifying a refresh id, the whole XPage is refreshed. Same happens if you refresh the UIViewRoot element. In both cases this includes your output scriptblock, and that is why your addOnLoad event is fired over and over again. A pager refreshs his parent component automatically. If your Pager is just added to your XPage, it will always refresh the UIViewRoot. To fix your problem, you can embedd the dataTable and the pager in a xp:div element. Another idea is to check in the rendered property of your output script block if a partial refresh is executed. EDIT: Check for partial refresh programmatically (SSJS): var ajax = new com.ibm.xsp.ajax.AjaxUtil(); if( ajax.isAjaxPartialRefresh(facesContext) == true){ return "AJAX"; }else{ return "NOT AJ

Categories : Javascript

jQuery event listener fires before selector applied?
Events bubble. When you click on the button, you're adding an event to the body. Once the event handler for the button is complete (meaning, the wrap now has a clicked class), it then continues to bubble up the DOM until it reaches the body. Since the body now has a new click event, said event also gets triggered. jQuery then looks within the body for an element matching the .clicked selector, calling the handler on any that it finds. To stop this, you can either delay binding the event to the body with a setTimeout, or stop Propagation on the button's click event so that it won't bubble up to the body. $('button').on('click', function(event){ event.stopPropagation(); ... Timeline: mousedown event is triggered, followed by a mouseup event both on the button click event handle

Categories : Javascript

Mousing over Infobox fires hover event on markers that are behind it
Ugly fix because none of the advertised options (enableEventPropagation) seemed to be working for me (and I certainly didn't want to go down the route of using "optimized:false" on 300+ markers) Inside the mouseover listener for each marker, I do a check to see if the currently-opened InfoWindow is being hovered over: google.maps.event.addListener(marker, 'mouseover', function() { //If an InfoBox is currently open if(openInfoBox !== null){ var id = $(openInfoBox.getContent()).attr('id'); //If the main div inside that InfoBox is currently being hovered over if ($('#' + id + ':hover').length) { return false; //go no further. i.e. ignore mouseover event for marker } } //Open InfoBox etc etc

Categories : Javascript



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