Skip to content
Advertisement

Tag: javascript

How can I ‘require’ CommonJS modules in the browser? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question What is the best way to load CommonJS modules as client-side JavaScript code in the browser? CommonJS modules put their functionality

Ajax and Jquery in Symfony

I’m a beginner in Symfony (version 2), I have a project achieved with plain basic PHP, and now I’m redoing my pages in dealing with Symfony framework, and arrived to my jquery ajax functions, surely, things gonna be different, I used to do like this: Q: How to make that works on Symfony? What to put instead of targetFile.php? a

Trying to unbind events on iPad2 with javascript

Bit of background, we are creating an html5 ‘app’ for the iPad, which has everything contained in a single page, and all the content is dynamic. I have a dynamically generated anchor, which then has a click event bound to it as so: This all works fine, however the problem is that once we navigate away from that page/section, and

In JavaScript, manually controlling order of event listeners

Assuming that FORM contains INPUT, have the following listeners: JavaScript Desired order of firing Nature of problem and attempted solutions Own code at FORM level, formFirst, formLast and middle, but have no access to INPUT code, inputFirst and inputLast – although could add own listeners on the INPUT. Attempt 1 modify formFirst() to create and dispatch a new change Event

Actual key assigned to JavaScript keyCode

I have setup an event listener: When the user presses 2 along with shift, how do I know if I should output (@) or (“)? Each users’ character mapping is different per locale. Answer Use the keypress event instead. It will reliably (barring a few edge cases) detect the character typed. There are a few browser oddities (such as some

How to get subarray from array?

I have var ar = [1, 2, 3, 4, 5] and want some function getSubarray(array, fromIndex, toIndex), that result of call getSubarray(ar, 1, 3) is new array [2, 3, 4]. Answer Take a look at Array.slice(begin, end)

Advertisement