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
2answers
100 views

How-To: a browser based, real time, shared memory inspection/debugger application

Background: I have a C application running under Linux utilizing shared memory. I also have a debugger written in Python that can link to said shared memory and access individual variable values of ...
-4
votes
0answers
31 views

How much/deep node.js should I learn before learning into node.js frameworks [on hold]

Hello guys I just finished recently two books about node.js and played with it a bit. I am wondering how deep/much should I learn before moving into node.js frameworks like sailsjs,meteor,express? ...
0
votes
0answers
91 views

Tips for writing self-documenting Javascript [on hold]

Revising my original question: What tools have people used to make Javascript APIs more transparent? By APIs, I do not mean writing public libraries, just within any non-trivial project, keeping ...
1
vote
1answer
91 views

How to respond with error message when making AJAX calls

I have an app that wasn't written by myself. If there is an error such as an invalid ID given as a parameter, I would return something like: (200 code) { "success": 0, "error": "The row ...
-4
votes
0answers
20 views

Does anyone know where I could find JavaScript problem sets? [on hold]

Not sure where to post this, but I am looking for some JavaScript practice problems to try out (of varying difficulties). If you know of any website that hosts these problem sets, or if you have your ...
0
votes
0answers
38 views

How to avoid module dependency chain nightmare caused by transitive dependencies?

Many (most?) AngularJS folks seem to advocate for breaking AngularJS apps up into many modules. Brian Ford in his blog already states that packaging by layer (controller, service, etc.) is a "silly" ...
-3
votes
0answers
16 views

send generic list from server to client and then client to server [migrated]

I have a asp.net page, list is generated after post back. List needs to be first updated at client side and then it needs to be updated at server side before showing results on the page. I don't ...
2
votes
2answers
164 views
+100

Practices for organizing JavaScript AMD imports

Our company has been using newer versions of the Dojo framework, which have progressed to an AMD-based loader format. I'm currently trying to find logical ways to separate layer files, taking a module ...
-1
votes
0answers
40 views

Choice of Web Development Technology [closed]

We are a small team of 1st time developers looking forward to making a custom designed E-commerce website.The technology should be more customizable than content management framework like Joomla, ...
2
votes
4answers
116 views

Overwriting and returning the value of the argument used as conditional of an if statement, inside the same if statement

A simplified example: function logTheColor (color){ if(color == "red"){ color = "The color is red " } else if (color == "yellow") { color = "The color is yellow " } else { ...
-3
votes
0answers
37 views

Javascript warning for Firefox 24 and other old webbrowsers [closed]

How would a javascript warning look like that warns the users that they are using old webbrowsers like: Firefox 24 Older IE versions Older Opera
-1
votes
1answer
88 views

Do you spend your effort to reuse obsolete unit tests or rewrite them entirely? [closed]

I have this javascript project which has a unit test suite(about 200unit tests) that covers about 11.31% of the code that it was testing. The project has evolved greatly but the unit tests where never ...
0
votes
1answer
171 views

Website with a lot of sound [on hold]

I am building a website with a large amount of sounds that should be played upon clicking elements. (It is a language learning website, and many words and phrases will be clickable, to hear ...
-1
votes
1answer
89 views

Create fake HTTP server to simulate an API for testing

I'm looking to mock responses from an external API service that returns JSON during live events. The first response would contain (fake) events that have happened up to time X, the second response ...
4
votes
1answer
464 views

How dangerous is it to take shortcuts when coding Web based applications? [closed]

I started working as a Web developer few months back. Previously, I had no prior professional experience in programming besides school classes and fun-side projects I did on my own. I am the only ...
0
votes
0answers
20 views

Filtering in Reactjs / Creating filter buttons [migrated]

I am trying to creating some reusable components to filter arrays, but I think I am doing something wrong. Should I be passing the handleclick all the way back up the chain of components like this? ...
0
votes
0answers
44 views

Mutual Authentication in JSON or AJAX only?

AFAIK we must install the client-certificate into the users browser to connect with https-sites using server-certificates to have a mutual authentication. What about AJAX and JSON, can we connect to ...
0
votes
2answers
201 views

Is JavaScript safe? [closed]

My company has been developing a site for a very large company. The site is now live, and it has received its fair share of hits. The site relies enough on JavaScript to make far less aesthetically ...
-2
votes
0answers
103 views

Is it possible to change out an image src=“” before the original image loads [migrated]

I've been looking at Javascript that can change the src of an image. I'm simply wondering if this can be done before the browser attempts to fetch the original image. Example. Src="Large-Image" ...
0
votes
2answers
71 views

What is the normative (best) use of Javascript arguments object [closed]

JS offers the 'arguments' object inside of functions to represent all passed arguments. Is there any broadly accepted concept for when/where this should be used? I've seen items like this in the ...
-1
votes
1answer
170 views

Is class with callbacks a code smell in JavaScript? [closed]

When writing JavaScript (especially in node.js), I tend to use plain functions and callbacks. However, sometimes there's some context to share between some functions and I don't like to pass this ...
1
vote
0answers
84 views

How to tell that a Javascript code already needs AMD (RequireJS, …)?

At some point code is complicated less if you introduce a new abstract than if you continue as it was. Some trigger should fire in a head of a programmer. Like, I was coding fine, but now I've added ...
0
votes
0answers
24 views

Why can't I use parens when executing function in return object? [migrated]

Can someone explain why, if I add parens to _start in the return statement I get the error: undefined is not a function _start is function, is it not? .factory('TrackPage', ['$location', ...
-2
votes
0answers
18 views

hide url param cakephp with refresh [migrated]

how do you hide / unhide / mask URL query parameters in cakephp? I've tried with javascript but still error when I tried the following pages of his. http://www.mywebsite.com/web/index/page:2?url=web ...
0
votes
2answers
139 views

What are the tecnhical reasons for email HTML, CSS, Javascript limitations and their persistance [closed]

If you've ever made a custom email you'll know that there are significant limitations in you need to be aware of. The most obvious limitations being: No support for Javascript in emails No support ...
0
votes
1answer
101 views

Declaring many times: script type=“text/javascript”

Trying to clear my HTML code, is it correct if in my web page I declare many blocks of <script> . Like this: <script type="text/javascript"> ... ... </script> <script ...
0
votes
0answers
44 views

Should there only be one controller per page within a JavaScript-based MVC architecture?

Let's say that I create a page in my marketplace web application where buyers can see a catalog of all products offered by some or all sellers or sellers can see just their own products in a preview ...
0
votes
0answers
57 views

Using Singletons in JS with workers

I'm building a javascript application that does continuous drawing, but relies on asynchronous scripts in the background which also need to poll for events and write to "global variables". This got me ...
4
votes
2answers
209 views

Dealing with browser cache in single-page apps

I'm trying to figure out how to properly handle the web browser cache for single page apps. I have a fairly typical design: several HTML, JS and CSS files implementing the SPA, and a bunch of JSON ...
0
votes
0answers
41 views

Scale parts of image to fill bezier path with no wastage

I want to be able to take an image and stretch/contract each pixel row (or 5 rows for performance) to fit within a curved shape. I've been searching for this for the last few days and have turned up ...
1
vote
0answers
159 views

Client side web application architecture - best practice & patterns [duplicate]

I'm inheriting some code that takes a rather different approach to architecture than I'd have chosen myself. It consists of a HTML page, some javascript library imports and a single DIV tag. This ...
-1
votes
1answer
90 views

Is there a way to run javascript on a present webpage [closed]

I don't have programming background. I have started learning javascript recently. I'm wondering if there is a way to run javascript on a webpage ? for example I would like to write a javascript on ...
0
votes
1answer
77 views

How to lock/unlock a button based on tweeting

I have a button that will be disabled until you send out a tweet that I have crafted. Only users with twitter accounts will have access to this, and I will require users to sign-in to be able to ...
0
votes
1answer
63 views

Common techniques to integrate social media login to a website that requires account registration

I have developed websites where users would register with a username of their choice and an entry would be created in a database table that holds their username and some sort of salted password. They ...
1
vote
0answers
102 views

How can I put multiple hierarchical forms in a single web page and avoid making it a mess?

We are a group of developers working on a web application that accepts forms filled and sent by our users and present it in an overall view. Our main form view looks like this: There are multiple ...
1
vote
1answer
66 views

Is doing Parent.call from the child object a right way to implement Inheritance in JavaScript?

I came across this piece of code it didnt look that right to me. Is it the right way to implement SUPER in javascript. if not what is the right way? function Person(name){ this.name = name; } ...
0
votes
2answers
115 views

In Node.js, are non-blocking constructs usually preferable to blocking ones?

Is the following a statement of best practices in Node.js with regard to web applications? If not, how could it be improved? The statement The lifecycle of any web app has at least two phases: a ...
1
vote
3answers
310 views

From a technical point of view, could JavaScript be compiled instead of interpreted?

The question title speaks for itself. I'm specifically thinking in terms of a Node.js server. Additionally, this question is assuming that you don't need eval(). Also, if this is not possible, why ...
1
vote
1answer
237 views

What is the “best practice” for converting an external API's data structure?

When an API's data structure does not fit well with an angular app, I am trying to determine the best-practice in my specific design and implementation for converting it to a usable structure. I was ...
0
votes
1answer
137 views

Ajax call or js to update a cart price

I am building a cart in Java and would like to give users the ability to update the quantity and see the new price instantly. I am using BigDecimal on the back-end for complete accuracy, but the ajax ...
0
votes
1answer
85 views

Finding “spare time” in a day from within a list of events

I have a list of events which is always sorted chronologically. The start time is always followed by the end time. Times are strings formatted as 'HHmmss'. // list of events var events = [ ...
0
votes
1answer
174 views

Cheerp — C++ for web: advance or regression? [closed]

Recently I've run into Cheerp, a C++ to Javascript compiler, which uses a modified version of clang to generate Javascript code from C++ sources. That makes me wonder: why in the seven kingdoms would ...
0
votes
2answers
78 views

Changing CSS classes when different strings are displayed in a text element with jQuery [closed]

I'm just wondering if this method would be possible using jQuery HTML and PHP. Basically I have a filtering system were products are listed, some have different attribute values such as Hatchback for ...
0
votes
0answers
170 views

What is the use of the prefix “for(;;);” in an Ajax response

After using the chrome debugger to inspect the ajax requests of Facebook (for curiosity), I noticed that the response is in JSON, however it is always prefixed with for(;;); In example, if the JSON ...
2
votes
1answer
170 views

Is this JS code a good way for defining class with private methods?

I was recently browsing a open source JavaScript project. The project is a straight port from another project in C language. It mostly use static methods, packed together in classes. Most classes are ...
1
vote
3answers
188 views

Falsey values vs null, undefned, or empty string

I've worked with jQuery over the years. However, recently, I've found myself getting deeper into the JavaScript language. Recently, I've heard about "truthy" and falsey values. However, I don't fully ...
1
vote
0answers
82 views

JS closures - Passing a function to a child, how should the shared object be accessed

I have a design and am wondering what the appropriate way to access variables is. I'll demonstrate with this example since I can't seem to describe it better than the title. Term is an object ...
2
votes
1answer
101 views

Uniform variable naming across HTML, CSS and JS

I'm sorry if this is opinion based, but how do you guys make sure that HTML, CSS and JS have uniform variable naming? I use vim, but I don't know if IDEs are smart enough to do this on their own. In ...
4
votes
1answer
99 views

JS design pattern/algorithm for avoiding duplicate redraws in a fairly coupled system

Given: some sort of widget based web app lots of JS functionality high coupling (communication/callbacks between widgets) widgets draw themselves certain widgets need to do a complete and fairly ...
0
votes
2answers
138 views

Old Browsers and Polyfills

Polyfilling, when is it too much? I've summed up this question into one sentance. Is it practical to polyfill all of the IE8 deficiencies with one solid javascript file, as in, would there be any ...