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)

1
vote
2answers
172 views

How do I find the JavaScript that is invoked when I click on a button or a link in a web-page (part of a data mining project)?

I tried to use the 'inspect element' of the firebug addon for Firefox but it doesn't give me any link to the javascript. For example I got this from the firebug add-on: <a href="javascript:"> ...
0
votes
1answer
104 views

MVC data binding

I'm using MVC but I've read that MVVM is sort of about data binding and having pure markup in your views that data bind back to the backend via the data-* attributes. I've looked at knockout but it ...
0
votes
4answers
286 views

What if(event) statement means in JavaScript? [closed]

I'm rather new to JavaScript and programming in general so I am pretty much only used to seeing if statements that have some kind of comparison operator like, if (x < 10) or if(myBool). I have ...
1
vote
0answers
41 views

Range searching with WebGL

Is it possible to use somehow WebGL to fasten up 1d range searching? I need to find overlapping date intervals, and I thought that 3d games usually have a very similar problem by rendering frames... ...
3
votes
1answer
117 views

Caching large amount of ajax returned objects

I'm building an application which fetches large amount of items with ajax requests via other application API. It returns me 6k - 30k js objects which are used multiple times across various application ...
0
votes
2answers
162 views

Javascript Rookie Question: Define Variables Inline

I'm proficient with HTML and CSS but I'm still pretty shaky when it comes to Javascript. That said, I've been able to build a site using the Internet Archive Book Reader, which relies on reader.js ...
2
votes
3answers
274 views

Is it necessary to start variable from zero (var i = 0 ) of ' for loop '? [duplicate]

Is it necessary to start variable from zero (var i = 0) of any looping ? When should I use var i = 1; and when var i =0;?
0
votes
1answer
53 views

Javascript: Machine Constants Applicable?

I write numerical routines for students of science and engineering (although they are freely available for use by anybody else as well) and am wondering how to properly use machine constants in a ...
0
votes
1answer
135 views

How to handle mutiple API calls using javascript/jquery

I need to build a service that will call multiple API's at the same time and then output the results on the page (Think of how a price comparison site works for example). The idea being that as each ...
0
votes
1answer
162 views

Website File and Folder Structure

I am having a problem learning how proper website structure should be. And by that I mean how to code the pages and how folder structure should be. Currently I am navigating around my website using ...
-3
votes
1answer
98 views

How to make a non-english clone of CoffeeScript? [closed]

I want to make a non-english programming language that is identical to what CoffeeScript is to JavaScript. What I mean is that I don't want to build my own design or syntax. Just want to have a ...
2
votes
0answers
62 views

Managing setTimeouts and setInterval in a distributed environment

I am building a turnbased game on nodejs using socket.io and redis as the datastore. I am planning on hosting the game on AWS opsworks with the ability to scale by adding more nodes. How should I ...
0
votes
2answers
120 views

Image caching when rendering the same images on different pages [closed]

I'm told to think about caching of images that will be displayed on the page. The images will be repeated throughout the website on different pages and I'm told to figure out the best way to cache ...
0
votes
1answer
133 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 ...
7
votes
5answers
432 views

Algorithm for flattening overlapping ranges

I am looking for a nice way of flattening (splitting) a list of potentially-overlapping numeric ranges. The problem is very similar to that of this question: Fastest way to split overlapping date ...
0
votes
1answer
83 views

Which approach would lead to an API that is easier to use?

I'm writing a JavaScript API and for a particular case, I'm wondering which approach is the sexiest. Let's take an example: writing a VideoPlayer, I add a getCurrentTime method which gives the elapsed ...
7
votes
1answer
121 views

Restructuring a large Chrome Extension/WebApp

I have a very complex Chrome Extension that has gotten too large to maintain in its current format. I'd like to restructure it, but I'm 15 and this is the first webapp or extension of it's type I've ...
0
votes
1answer
217 views

Should I use my own public API on my site (via JS)?

First of all, this question is far more different other 'public api questions' like this: Should a website use its own public API?, second, sorry for my English. You can find the question summarized ...
0
votes
1answer
96 views

Javascript Event in Innerhtml Resulting from PHP Server Script

I'm (very slowly) making a website, and I'm creating a search engine for the database, which is essential to organize the dependencies during data entry. Anyway, what I would like is to type a few ...
0
votes
1answer
185 views

With AMD style modules in JavaScript is there any benefit to namespaces?

Coming from C++ originally and seeing lots of Java programmers doing the same we brought namespaces to JavaScript. See Google's closure library as an example where they have a main namespace, goog and ...
0
votes
1answer
141 views

Difference between lexical scoping and passing variables in JS

There are several ways to reach the same end point in JS, for example: (function (foo, bar) { return {run: function () {return foo(bar);}}; } (foo, bar)); (function (foo, bar) { return ...
1
vote
1answer
144 views

Is it alright to create another reference to a javascript object just for ease of access

I have a use case where I need to create say two javascript objects & use their properties in one another. eg - var Object1 = { settings: { property1: 'someValue', property2: 'someValue' ...
0
votes
0answers
85 views

Should we still care about _escaped_fragment_ and alternate HTML generation for Single Page Applications?

A few months ago I started a project, which will have two parts – business client overview panel (AngularJS SPA) and public front-end (dynamic HTML with progressive enchancements via XHR). I'd really ...
2
votes
4answers
149 views

Should our team order Javascript class methods/properties consistently? If so, how?

As our team is growing I've noticed that different developers put their class methods in different orders. For instance: var Foo = Backbone.Model.extend({ someVar: {}, initialize: ...
1
vote
2answers
768 views

Should you use PHP to render the html page or use javascript frameworks? Server-side page rendering or client-side page rendering? [closed]

This may be a inappropriate question, but I'm really need help demystifying this. Suppose we want to create web application like reddit or Gmail. The way I understood it from my research is that ...
-1
votes
2answers
303 views

Javascript, JQuery and now AngularJS What is happening? [closed]

I have been away from computers for about 3 years and starting to get back into programming. Lots has changed in resources and help sites available on the web especially the evolving StackExchange ...
3
votes
1answer
225 views

How significant is node's advantage of training developers in only one language and putting them on tasks across the tech-stack? [closed]

I have recently joined a startup as CTO/co-founder. The startup and I have been thinking about moving the existing codebase (which is in PHP5.5, laravel framework) to node.js . Main reason for this ...
1
vote
1answer
198 views

For web apps (vs web pages) why not put scripts and css inline? [duplicate]

I understand that for normal websites you'd want to share scripts and css and therefore liking to them means that each page shares them from the cache. But this question is not about "normal multipage ...
3
votes
1answer
134 views

How to handle asynchronous calls in an offline application

I'm using an offline application's javascript API and I'd like to know if I can use deferred objects to handle the callbacks. The API calls do not use HTTP, the calls are to and from the applications ...
1
vote
1answer
294 views

Should we push for more JavaScript on the JVM, alongside Java and Scala? Or, if not, why?

With JavaScript becoming one of the most widely used languages around, I began asking myself why people do not find ways to use it extensively on the JVM. As a programmer who spends half day writing ...
0
votes
1answer
96 views

Javascript based application controller in Javascript-less environments

I just got done watching an informative Box tech talk by Nicholas Zakas on a javascript architecture for web development: https://www.youtube.com/watch?v=mKouqShWI4o&feature=youtu.be This image, ...
1
vote
0answers
127 views

Should I use SignalR to synchronize & cache CRUD data to a mobile app?

I'm considering using SignalR to send data to a mobile app, but need to have a way to synchronize data while it's closed or pending updates. Is it a good idea to use Backbone.js <--> SignalR to ...
1
vote
2answers
226 views

Polling vs events pros and cons in JavaScript

I'm bit of a novice to JavaScript so I've been wondering on positive and negative sides of using polling compared to using events in JavaScript? When does one use one or the other? By polling I ...
0
votes
0answers
64 views

What is a good method of storing test data for development and unit testing with angular and jasmine?

What is a good method of storing JSON data/objects for development and unit testing with angular and jasmine? I have seen some ways of accomplishing this. However, since I am new to unit testing with ...
0
votes
2answers
129 views

A license like the LGPL, but compatible with JavaScript

I have written a library that is quite extensive and has taken up a lot of my time, so I would like to license it properly. The LGPL seems to have many of the things I want, but does not work with ...
0
votes
0answers
64 views

JavaScript strict mode compatibility

While reading about strict mode on MDN I really was surprised to read the following near the end of the page, quote: Browsers don't reliably implement strict mode yet, so don't blindly depend on ...
1
vote
2answers
199 views

What license is HTML released under?

All products seem to be released with a license, I'm curious to know how one would go about finding out the license of technologies like HTML, CSS and JavaScript?
2
votes
1answer
125 views

Designing javascript chart library

I started coding a chart library on top of d3js: My chart library. I read Javascript API reusability and Towards reusable charts. However, I am NOT really following the suggestions because I am not ...
3
votes
5answers
2k views

Pure Front end JavaScript with Web API versus MVC views with ajax

This was more a discussion for what peoples thoughts are these days on how to split a web application. I am used to creating an MVC application with all its views and controllers. I would normally ...
0
votes
1answer
327 views

Javascript/ui framework to compliment WebAPI/TypeScript/ASP.NET MVC? [closed]

We're about to venture into building a brand new SAAS application that needs to have a great looking and sophisticated front end. The UI is meant to be single-page, built on top of Web API and using ...
0
votes
1answer
106 views

Send mapped data from server-side code to client-side code

I'm developing a application based on two technologies: ASP.net (SharePoint) and JavaScript. I use server-side code for retrieve data from database and manipulate it whereas I use client-side code ...
7
votes
2answers
373 views

Javascript MVC application design (canvas)

I'm having difficulty grasping how to structure/architect a canvas application using an MVC like approach in Javascript. UI will be fairly fluid and animated, the games fairly simplistic but with ...
-2
votes
1answer
140 views

Develop a website using mustache.js and PHP [closed]

I'm thinking of building a website using mustache.js to render the website and having PHP as the backend. The PHP will then mainly contain queries to the database and some SESSION checkings. ...
1
vote
0answers
91 views

Methods for structuring JavaScript SDKs

I've built a REST API and have been using Backbone models throughout a couple different applications to communicate to it. I would really like to build a single JS SDK that can be used in any ...
2
votes
3answers
234 views

jQuery - When to Bind Event Listeners?

I'm building a medium-sized "single-page" JavaScript application using jQuery. If you include all possible functionality of the application, there are 134 click bindings. Since most of the content is ...
-5
votes
1answer
101 views

How to make your JavaScript private? [duplicate]

I wanted to know if there is a way to make your JavaScript private from client side?
-3
votes
3answers
928 views

How to not let anyone inspect elements of a webpage?

I was thinking to make some jQuery functions that will use ajax to control mysql. The whole idea is to make separate files of PHP (e.g query.php, addRow.php, update.php and delete.php) provide data to ...
0
votes
1answer
994 views

Global variables in javascript

I don't consider myself a highly skilled javascript developer, but I thought I got one thing right for sure: don't create global variables unless you really have to. I've been learning angularjs ...
1
vote
0answers
56 views

How do I manage a JavaScript library with TFS?

I know that I can share files between Visual Studio projects using linked files and assemblies using project references. Is there a good approach for JavaScripts? I'd rather not use linked files since ...
0
votes
1answer
173 views

Should we use any JS framework which makes HTML as scripting language [closed]

After studying HTML 5, I learnt that HTML is purely for defining semantics of data. And it has provided various tag for each purpose. Although we can create our own tags, can provide styling and it ...