I have one function with two parameters, for example function (a,b). I want to within the function, take the value of b, and replace that with c. I was thinking of something like $(b).replaceWith(c), but it didn’t work out. I know I can create a new variable within the function with the new value, but is it possible to change
Using the jQuery each() function to loop through classname elements
I am trying to use jQuery to loop through a list of elements that have the same classname & extract their values. I have this.. I was reading up on the each() function though got confused how to use it properly in this instance. Answer and if you wanted to get its index in the collection: Reference: .each() and .val()
How to run a function in JavaScript every time a variable changes?
Is there a way in JavaScript to have something like an event that listens to changes in a variable? so when its value is modified the event triggers and then I can call a function. To put this more into context I have a function which handles the html rendering of an array of objects, and I want that function
Architecture query.. Building a service/message bus with Node.js
So the situation is that I have a variety of datasources that are providing a stream of messages from external devices.. some are sending messages on a serial port, some via UDP, some via Telnet.. I wish to build a small Node.js system that receives messages from each of these sources. Around 20 sources all up. I have a variety
Table Row’s OnClick Event is Propagated to all Contained Elements?
I’ve run into some interesting code in our legacy application running under Internet Explorer. Consider the following: So, here’s where I’m stumped. When the user selects an item from the SELECT element, the ONCLICK event is firing, and the following are true: this evaluates to Window Window.event.srcElement evaluates to an array of ‘OPTION’ elements There doesn’t seem to be a
What is the hash tag used for in JavaScript?
I’m not talking about in the URL. I know what that does. I’m talking about how it’s used in actual code. After trying to assign it as a variable, I realized that it’s reserved, but I don’t know what for. Answer Javascript, or more precisely ECMAscript, is an evolving language. Some symbols and keywords (such as “class”) have been reserved
How to get first and last day of the current week in JavaScript
I have today = new Date(); object. I need to get first and last day of the current week. I need both variants for Sunday and Monday as a start and end day of the week. I am little bit confuse now with a code. Can your help me? Answer This works for firstday = sunday of this week and
How to detect if multiple keys are pressed at once using JavaScript?
I’m trying to develop a JavaScript game engine and I’ve came across this problem: When I press SPACE the character jumps. When I press → the character moves right. The problem is that when I’m pressing right and then press space, the character jumps and then stops moving. I use the keydown function to get the key pressed. How can
Convert javascript code to c code [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question Is there any way to convert C code to JavaScript and from JavaScript to C? I found V8 juice which
Convert json data to a html table [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. Closed 8 years