JavaScript is the original and common name applied towards most flavors of a scripting language that originated on NetScape Navigator. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

learn more… | top users | synonyms (1)

0
votes
1answer
18 views

Is it possible to use on focus event on form..?

I tried to find when and on what onfocus works.. Can some one tell me is it possible to trigger event when some one is viewing current form ?? I know it works on input,dropdown and textarea.. but ...
0
votes
2answers
49 views

Using PHP without mixing presentation logic

I'm conceptually designing a website / application and trying to come up with the correct separation of concerns. The basic technologies I'm settling on are: MySQL, PHP (Laravel), HTML/JS (jQuery). ...
3
votes
2answers
67 views

why regex, when using global search and {0,} quantifier, match the end of the string?

I have asked a question here about js, regex, quantifiers and global search. I've understood finally how this works, but, let's take a concrete example and then I`ll write my question. Based on the ...
2
votes
3answers
178 views

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard ...
2
votes
6answers
629 views

Replacing C with JavaScript as an introductory programming language [on hold]

I am a new teacher at polytechnic where we teach web development and basic software programming. For years, the institution where I teach have taught C as their introductory programming language to ...
-2
votes
1answer
41 views

(New Programmer Alert) As I'm learning Javascript and Jquery What Else Should I learn? [on hold]

I'm a new programmer and kind of over whelmed by all the other awesome stuff there is to learn. I've gotten HTML and CSS down and now want to make my websites more interactive. I know with Javascript ...
-3
votes
0answers
15 views

How to pass input text box value from previous page to input text box in the new page with Javascript? [on hold]

Any help appreciated.. I have been stuck on this for a while.. Right now once it gets the searchVal from the old input text box, it redirects to new page and then stops doing any javascript after ...
-1
votes
0answers
14 views

upload a file to sql server and download it from sql server in asp.net mvc web api using knockout js [on hold]

I'm very new in asp.net mvc web api (APIController)and knockout js but i want to upload a file to sql server and download it from sql server in asp.net mvc web api using knockout js , i'm looking for ...
-2
votes
0answers
7 views

Problem with device orientation code in Firefox for Android

The following code is supposed to make a map on a web page be the only element that is displayed on the page when the phone is turned sideways, and then re-adds the other elements when the phone is ...
0
votes
1answer
664 views

Jasmine BDD vs Integration Tests

Let's say I need to write a test for the front end, in the following BDD style: A user visits buysomething.com, saves something to their wishlist, and a saved item count is updated. The result ...
2
votes
5answers
263 views

Securing ajax calls to rest api

I need for my app to consume a rest api service and since I will call it from javascript/jquery i need to expose it to the end user. In this case I would also need to expose credentials to the end ...
0
votes
0answers
40 views

Vertical Single Page App libs/patterns?

Lately I've noticed a trend amongst some website homepages to present information in a vertical fashion, forcing the user to scroll down to continue reading the content. As you scroll down, a state ...
0
votes
0answers
56 views

How to use a href link just like a button? Which can perform some event? [on hold]

I need the help in web programming concept. I want to create a link which will perform a login redirection. I want a reader view which will display some information To perform login we have to open ...
0
votes
2answers
154 views

Javascript inline event handling versus external jQuery event handlers

Working on a dynamic website that loads information from a JSON file and then populates the page with said elements. My question has to do with event handling - as of now, I don't see any reason as ...
-3
votes
0answers
75 views

Javascript entry-level interview [on hold]

I like to program and have been in pursuit of a developer career. I have some basic knowledge in most programming languages out there like C++, C#, Java, PHP, Python, etc. I also know HTML/CSS and ...
0
votes
0answers
35 views

Nested website navigational menus [on hold]

So, I have created a website that has a navigational menu made up of nested unordered list elements. For example, <ul> <li>Home <ul> <li>About Us</li> ...
0
votes
0answers
18 views

dynamic api code generation in nodejs

We are using nodejs and cassandra for backend stuff. In past few months we wrote same CRUD code for different apps. I am thinking of some way to automatically generating CRUD code. I came across ...
2
votes
1answer
142 views

What would be a reason not to embed JS in C? [on hold]

I'm working on an opensource application that processes JSON in C, because I would like to make it easier for people to help me in the project and because JSON is so close to JS. I want to embed a JS ...
1
vote
1answer
71 views

Which JavaScript Template (jst) syntax uses double-brackets, (e.g. [[ and ]] )?

I'm looking at the source code for a Rails application that uses Backbone and there are template files with .jst.ejs extensions. The templates include HTML with lines of JavaScript wrapped in ...
1
vote
1answer
140 views

html/css/javascript for game ui's

I've been looking into game ui's recently. My conclusion is that html/css/javascript would be the perfect solution IF it was wrapped up in a nice C++ library that allowed for easy integration into ...
-5
votes
0answers
28 views

copy and paste from text box to text box [on hold]

you can make a little program that copies the text of a text box on a web site?. I refer to the email address temporary guerrillamail. and to pass this argument to another text box to another website? ...
0
votes
1answer
45 views

Is there a relationship between a data source (JSON) and the Model that consumes it?

I have put together a large quiz data structure. It is in JSON format but I guess it could be XML etc. It may look something like this simplified: { "quiz":{ "title": "Welcome to Quiz" ...
0
votes
0answers
43 views

JavaScript: How future-proof is using the onpaste event? [on hold]

I've been building a jQuery plugin which, along the way, required me to handle the user pasting a value into an <input> element. I've handled this by using the onpaste event. However, ...
0
votes
2answers
79 views

How can I show and hide a single field across my web application through a checked value?

Let's say I have a field called "FooName" and I have "FooName" in several places across my web application (ASP.NET MVC4). I have a check box that allows me to turn "FooName" on and off across the ...
-1
votes
1answer
88 views

JS Asynchronous Load Pattern

This is a specific problem but I believe the pattern here may be general enough to be useful to the audience here. I'm working on an offline JS application. In my JS application, I would like to run ...
-2
votes
0answers
29 views

Angular service with different angular app [migrated]

Here i am using angular service.In my case i am getting value for first app but not for second .please help me . thank you. here is my html:- <div ng-app="mainApp" ...
1
vote
1answer
49 views

Does requestAnimationFrame() really align with monitor refreshes?

Take this code: requestAnimationFrame(function (timestamp) { console.log('one', timestamp); }); requestAnimationFrame(function (timestamp) { console.log('two', timestamp); }); // logs: // ...
32
votes
3answers
3k views

How much should I be using 'let' vs 'const' in ES6?

I've been writing a lot of ES6 code for io.js recently. There isn't much code in the wild to learn from, so I feel like I'm defining my own conventions as I go. My question is about when to use const ...
-1
votes
0answers
5 views

D3 show segment of series data [migrated]

I'm looking for advice on how to tackle the following chart in D3.js: I have data in the following format for the 7 series shown Learning Disability AgeBand | Percentage 0-4 | 0.02 5-9 | ...
4
votes
1answer
188 views

Is localStorage under The Cookie Law?

I'd like to avoid having the cookies banner on my websites where possible. Could I store session id's in localStorage to bypass implementing the banner?
2
votes
1answer
113 views

Managing Massive Updates with Resource Access

I have a number of data servers that are pushing data to a main server as in this kind of architecture: These data points (points for short) are updated randomly from each server. On the server, ...
1
vote
1answer
71 views

Any point in using ES6 Map when keys are all strings?

Plain object keys must be strings, whereas a Map can have keys of any type. But I have little use for this in practice. In nearly all cases, I find myself using strings as keys anyway. And presumably ...
0
votes
0answers
74 views

Javascript: Scan webpage for links [closed]

Using JavaScript, I would like for a user to click on a button that prompts them to enter a URL. The URL entered is then scanned for links. The source link and links on the page are then placed in a ...
0
votes
1answer
222 views

Is writing code chronologically the best way for readability? [closed]

So I've been writing a lot of JavaScript lately. Despite what many people say I think JavaScript can be a simple and beautiful language. What I've pondered of late is how to structure the code so it ...
0
votes
0answers
57 views

Why does a lot of Angular source code avoid enclosing the contents of a file in a closure?

I am assuming because it is a standard practice in the Angular world that, any sort of module system has to be wrapped as an Angular module and angular should be the only global variable used which ...
1
vote
1answer
62 views

The difference between bind and _.curry

So JavaScript's bind supports currying, but most people use some other library like lodash or ramda to do currying. From first impression It seems like bind supports context changing, since that is ...
11
votes
2answers
10k views

Webkit as GUI in .Net/Mono

I want to make a cross platform application, which will also have a website where the desktop applications (Windows, iOS, Linux) will talk to the server and keep the users data in sync. So far the ...
0
votes
0answers
23 views

JavaScript top and left positions not working? [migrated]

I have this code in JavaScript on a html file but when i run it the image that i have doesn't move when i change top or left. Why is this happening, i have been searching for hours and copying tones ...
4
votes
0answers
217 views

When to use Prototypes & the correct usage of Prototypes ( Javascript )

I have been programming in Javascript for a while and I am quite comfortable with it. And I know the basic concept of prototypes and I have also used them a few times. But one thing I can't figure out ...
0
votes
1answer
50 views

Should the server and client portions of an SPA be separate repos? [closed]

I'm building an SPA (my first), and I had a question about organization. (I'm using Node.js for the server and Browserify & React for the client, and that's mildly important later). I'm unsure if ...
0
votes
1answer
172 views

What are known approaches to graphing algebraic expressions?

I am planning to build an expression parser that will be used to graph algebraic functions ( think TI-83 ) with JavaScript. Functions will take the form of f(x)= Aside from typical operators such ...
2
votes
0answers
44 views

Mapping different XML and CSV feeds

Not sure if this is the right venue to be asking this but here goes. A little background. I'm trying to build an ecommerce app that would allow sellers from other venues--like, amazon and newegg--to ...
55
votes
3answers
6k views

Why do JavaScript frameworks/libraries have functions which already exist in pure JavaScript?

I wonder why frameworks/libraries have their own helpers although they exist natively already. Let's take jQuery and AngularJS. They have their own each iterator functions: jQuery.each() ...
2
votes
0answers
99 views

is this a valid javascript design pattern when many instances are required?

I have some code that I'm refactoring, right now its just a list of functions, primarily jQuery. The code is a form builder. The user adds sections, questions etc using jqueryUI drag/drop/sort. They ...
1
vote
2answers
234 views

Live search/filter as you type in client approach

As an exercise for myself to practice my JavaScript "skills" I'm trying to write a client-side filter. It should be able to filter "content blocks" as the user types. By "content block", I mean a ...
1
vote
1answer
106 views

What is the name of the pattern for passing an incomplete object to a constructor? [closed]

Several times in javascript I've seen a constructor function take in one parameter. The constructor will initialize all the fields for the object to default values and then use the parameter to ...
1
vote
1answer
62 views

Best place to declare functions in this example

Suppose I have code that accepts html GET requests: server.get('path/to/some/endpoint', function(req,res) { function a() { //function goes here } } Is it better to declare functions ...
0
votes
2answers
113 views

The correct way of declaring & instantiating variables ( Javascript ) [duplicate]

I have seen other peoples code and each person has a different way of declaring variables. And I have been told by quite a few people that declaring variables in the Global Scope is wrong. My ...
4
votes
1answer
431 views

Local Updates in Persistent/Immutable Data Structures

I'm getting into ReactJS and am intrigued but also confused about persistent data structures. I love the idea, but I'm not sure how to take my MV*, Mutable, Observable Bindings experience in designing ...
29
votes
12answers
4k views

Why the recent shift to removing/omitting semicolons from Javascript?

It seems to be fashionable recently to omit semicolons from Javascript. There was a blog post a few years ago emphasising that in Javascript, semicolons are optional and the gist of the post seemed to ...