Skip to content
Advertisement

Tag: dom-events

Want to fire Dropdown SelectedIndexChanged Event in Javascript

I have dropdown on my page, I am changing selected value of dropdown from popup window using Javascript. I have some logic in dropdown SelectedIndexChanged event, so I need to fire the SelectedIndexChanged event when dropdown selection changed from Javascript. Answer This should work, if you are still getting some error, you can try like this: yourcontrolClientSideID is the ID

How to call public method from a event handler

I have the function below. Everything works fine except for the Push, Pop and Remove method. These method should be called by the event-handler. This event is fired by the Google Maps API. The problem is that when the event is fired, these method are not found. I have a “Push is not defined” error message. I tried with this

JavaScript function not working in Mozilla

Below function is working fine for IE, but not working for Mozilla and other browsers: What I am trying to do is, I have a button on a page after clicking on that button, a page in opened in new window having session, the session will be maintained until user closes the browser. on the new page there is right

Prevent click event from firing when dblclick event fires

I’m handling both the click and dblclick event on a DOM element. Each one carries out a different command, but I find that when double clicking on the element, in addition to firing the double click event, the click event is also fired twice. What is the best approach for preventing this behavior? Answer In a comment, you said, I

Javascript Object Confusion

I’ve confused myself nicely here. My scenario is as follows: I can’t seem to call Dragger.RemoveAsset. I understand the why, my question is how do I call it? I’m trying to keep like-things separated (e.g. Dragger / EditBar) but I seem to get all sorts of mixed up in my event handlers. Any suggestions, good reading materials, etc. on this

How do I programmatically click on an element in JavaScript?

In IE, I can just call element.click() from JavaScript – how do I accomplish the same task in Firefox? Ideally I’d like to have some JavaScript that would work equally well cross-browser, but if necessary I’ll have different per-browser JavaScript for this. Answer The document.createEvent documentation says that “The createEvent method is deprecated. Use event constructors instead.” So you should

Trying to wrap my head around custom events

I’m trying to get my head around custom events. I understand how to register and trigger custom events. However, it seems like its not possible to register truly custom events. Everything has to trace back to a DOM event like click, onload, blur, etc. Or am I wrong? For example, suppose I have an array. I want to register an

Cross-browser way to determine whether a DOM event was cancelled

Is there a cross-browser way from a Javascript event handler to determine whether the event has been cancelled by a previous handler? IE and other browsers like Chrome etc. have an event.returnValue property that can be tested, but FireFox doesn’t appear to have any such property. Here’s an example of the scenario I’m talking about. You have a form like

Advertisement