0
votes
4answers
20 views

JavaScript- variable scoping and event handler

Please see the jsfiddle: http://jsfiddle.net/LsNCa/2/ function MyFunc() { for (var i = 0; i < 2; i++) { // i= 0, 1 var myDiv = $('<div>'); myDiv.click(function(e) { ...
4
votes
4answers
39 views

How to pass a variable by reference to an event handler in javascript?

I simulated a class in java script, It's code is here: function myclass() { this.count ; this.init = function(){ $("div.mybtn").click({n:this},function(e){ ...
0
votes
2answers
41 views

Javascript IE8 wrapper for existing onclick event

I have to call another function before the original onclick event fires, I've tried a lot of different paths before I've come to following solution: function bindEnableFieldToAllLinks() { var ...
0
votes
0answers
37 views

Should I remove all the event handlers?

Most of the time, I don't remove the event handler when there is only one or two of them. But now I am designing a webpage that will use ajax to fetch HTML content to append into the DOM. ...
0
votes
3answers
34 views

jQuery use an object's method as an event handler

I have an object. It initializes a button to alert "Hello!" when it is clicked. Why won't this work? jsfiddle: http://jsfiddle.net/kUT52/1/ HTML <button>Test</button> JS var ...
0
votes
1answer
46 views

javascript keyboard events and detection

I am trying to stay clear of jQuery and want to detect if the left or right key is pressed. I am having trouble just getting this to work. var keyPress = function(event) { var keyCode = ...
0
votes
0answers
23 views

Automating form filling and sending it to server more than 1 time using java script

I have to fill a form everyday and send it to server.I have to set some values and then I have to click a button to send them. Sometimes I need to send it only one times and sometimes I have to send ...
2
votes
2answers
73 views

The best way to add eventlistener to an element

I'm trying to find the most productive way to hanging event. Lets imagine we have this structure: <ul> <li> 1st li </li> ... <li> 99999th li </li> ...
0
votes
2answers
30 views

dojo aspect and key press

Is there a way to capture a key press event with dojo/aspect and aspect.after? I am using a third party Javascript API (ESRI JS API v3.4) that provides a widget for drawing graphics on a map. The ...
0
votes
4answers
55 views

Can't use off() to turn off event handlers with an event handler for a dynamic list (jquery)?

First off I'm new to js/jquery. I have a list that can be modified and added to within the page defined by: <ol id="elementlist"></ol> On page load, it is an empty list. List items are ...
0
votes
1answer
57 views

Adding an event listener to a div to perform an event if the div becomes empty (has no children)

My goal is the following: create a listener that will be binded to a div and it will fire up if there are no children left in that div. I keep seeing how to bind a listener to say onClick etc.. but ...
4
votes
1answer
33 views

Multiple on() or switch() within one on()

I have a menu on my page and am currently writing the script that sets all the click events for the menu buttons. Each button will call its own method so it must be set explicitly. My question, quite ...
0
votes
2answers
221 views

SharePoint add javascript event to a editForm.aspx page

I have a Sharepoint list where I want to customize the editForm.aspx page with javascript. The problem is that I can't manage to add any events to the controls in that page. I am able to get a ...
0
votes
2answers
56 views

Javascript: Understanding Event Delegation Handling

I am trying to use event delegation for different forms on the same page. However, I am getting an interesting problem while trying to submit the forms. I tried 'click' on one form (intended for the ...
0
votes
1answer
38 views

Overriding parent prototype method for event handling

I am using the following code jsFiddle to work with form fields and events. I have previously asked two questions regarding this and they have helped me tremendously. Now I have a new ...

1 2 3 4 5 20
15 30 50 per page