0
votes
2answers
87 views

Javascript override of jQuery (or any other object's) method

In this jsfiddle, the author writes a test for some custom knockout binding. As part of the test, it seems that he/she extends jquery. Is my understanding of line 30. $.fn.on = function(event, ...
0
votes
1answer
966 views

Uncaught ReferenceError: X is not defined - declaring object on js file, making reference inside html button event

I want to define a Javascript object inside a js file and make it possible for users to create new instances of it on their HTML by calling the src on the head and then using "new". [maybe this is not ...
0
votes
1answer
730 views

javascript onclick event call object [duplicate]

Possible Duplicate: How do I pass the this context into an event handler? I am doing a javascript related assignment and am required to make a calendar which is assocated with a particular ...
1
vote
1answer
137 views

How to move javascript functions within object and DRY?

In functions presented below are repeated the same operations. I'd like to move as much as possible to the object. Maybe it is possible directly from button once initialize right method in object? ...
1
vote
2answers
70 views

Adding event handlers on object creation doesn't work? JavaScript

I have the following: MycheckModal.__construct = function(element){ this.blackout = $("<div class='modal-backdrop'></div>") .attr("style", ...
0
votes
0answers
92 views

Detect event object in ie7

I have a little problem in ie7. In ie8+ I can detect the Event object with this code: event instanceof Event or event.constructor === Event but in ie7 I have no Event object, so the question ...
4
votes
3answers
471 views

JavaScript “this” referce to wrong object

Well, this doesn't really refer to the wrong object, but I do not know how to refer to the correct one. function someObj() { this.someMethod1 = function() { var elementBtn = ...
2
votes
0answers
613 views

Synchronous vs. asynchronous for publish subscribe communication between JavaScript objects

I implemented the publish subscribe pattern in a JavaScript module to be used by entirely client-side oriented JavaScript objects. This module has nothing to do with client-server communications in ...
1
vote
1answer
384 views

Better approach nulling variables, objects in javascript

I am building something for mobile and would like somehow to clear, null objects, variables to release a bit of memory. Here I have two quick examples, both are anonymous functions as I believe but ...
2
votes
1answer
2k views

object.watch(), getting new value

In Firefox, I've got several objects that I need to trigger an event when a particular property of each is changed. I'm using object.watch(), however when I return the value of the property that was ...
0
votes
1answer
41 views

How do you create a reference to an object from its name as a string?

window[objref] does not work self[objref] does not work either Here is jsfiddle. Here is the code: var bob = { n: {}, y: { somekey: 12, oo: 'yah', pop: { ...
1
vote
6answers
2k views

click() a button named 'submit' in Javascript

I have this HTML: <input type="submit" name="submit" value="Invoeren" accesskey="s" class="buttons"/> I'd like to click() it. I can not change anything on the HTML-side. When I do ...