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
223 views

Application use on website

Is there a good way to run a C# application on clientside in lieu of JavaScript? I have done some front end work with JavaScript and backend C# for web developing at an old job, but I am interested in ...
-4
votes
0answers
28 views

Working knowledge of HTML, CSS, JavaScript, C# and SQL Server [on hold]

What does it mean if a employer asks if you have working knowledge of HTML, CSS, JavaScript, C# and SQL Server?
25
votes
14answers
7k views

What benefits are there to native JavaScript development? [closed]

Given how much simpler jQuery development is, when compared to native JavaScript, what makes people forgo libraries like jQuery altogether? Is this because jQuery has limitations or it is slow? I ...
1
vote
3answers
171 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 ...
4
votes
2answers
135 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
1answer
84 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 ...
1
vote
2answers
119 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 ...
0
votes
0answers
34 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 ...
-1
votes
0answers
33 views

Most common use cases for task runners [on hold]

Often I see company job descriptions list task runners as a preferred skillset. Some of the companies that list this are sometimes seen using a framework like Rails which has its own asset pipeline, ...
0
votes
0answers
50 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 ...
2
votes
1answer
133 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 ...
0
votes
0answers
36 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 ...
-5
votes
1answer
58 views

Preventing a Javascript object function called twice [on hold]

I am trying to reuse an object but my function is getting called twice. Here is what I have: var KEYBOARD = { template: 'keyboard', getkeyboard: function(){ console.log(this.template); } } ...
0
votes
0answers
57 views

What kind of design pattern for an “investment” system? [on hold]

I'm developing a browser game with Node.js. I'm trying to make an "invest" function, letting users invest according to their balance. For example: A user came and invested 20 dollar %40 of ...
0
votes
1answer
62 views

Backbone vs Angular/Ember for a 1-3 person development shop? [closed]

We are a really small (1-3) Ruby shop building a Rails application and need to pick one of the 3 (we've narrowed down to) JS Frameworks. Assume plenty of development experience overall but very little ...
-1
votes
1answer
115 views

JavaScript: testing with undefined value [on hold]

While learning more about IE’s documentMode property, I came across some sniffing code, which, of cause, fails in browsers like Firefox. However, a simplified version of the test would readas such: ...
0
votes
3answers
494 views

Is $.proxy a code smell?

I've been writing most of my javascript applications in an OO style close to what I would use for most other languages. However, this means that most callbacks need to have a reference to an object, ...
0
votes
0answers
99 views

How to code a function to be used with or without callback on Javascript? [migrated]

I'm wondering how (if possible) I can create the same function, with exactly the same functionality, but to be used with a callback or without it. Here is an example with the "wanted effect" that is ...
-2
votes
0answers
48 views

How to extract JSON schema, using Java, from data without using available libraries? [closed]

The problem in extracting schema from any given data is that they can have other JSON objects embedded in them which in turn have others. Also the types of the values in the name-value pair have to be ...
12
votes
7answers
2k views

What constitutes “Proper use” of the javascript Eval feature?

Eval is a notoriously controversial language feature. Douglas Crockford flat out rejects it. I'm wondering what specific risks Eval brings about. According to this question, Improper use of eval ...
-2
votes
0answers
20 views

How do you make the node_modules folder read/write in WebStorm [migrated]

I'm using WebStorm on a Node.js project and want to edit the files in the node_modules folder but WebStorm won't allow this. I found the padlock at the bottom right on the IDE but switching that ...
0
votes
1answer
59 views

Creating a voting platform for submissions during timeperiod

I have a site where stories are submitted at any time by users. The staff would like the ability to create a voting period at any time. For example, they can choose to open up voting from today until ...
1
vote
0answers
157 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
83 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
3answers
498 views

How to approach multiple page form with just one save option

The screen shot shows the magento product upload page. The left nav allows you to switch to different options for the product. Basically each option in the left nav appears as a different page. ...
0
votes
1answer
74 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
49 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 ...
50
votes
14answers
5k views

Is it a bad idea to return different data types from a single function in a dynamically typed language?

I come from a statically typed language background (Java). In Java, you have to return a single type from every method. For example, you can't have a method that conditionally returns a String or ...
0
votes
0answers
76 views

What does this javascript file do? Is this a virus? [migrated]

While searching on google I found a website that shows other content to Google Bot and other to his users, and also a very suspicious javascript file. Maybe it's a tracking cookies virus/malware, I ...
-1
votes
5answers
232 views

Can we use `a <= x <= b` to check if `x` is between `a` and `b`? [closed]

How to give conditions for geographical directions based on degrees? for COMPASS API Reference... I have tried this...but not working if((0 <= a <= 22.4) || (337.6 <= a <= 360)){ ...
1
vote
0answers
99 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
49 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
104 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 ...
0
votes
1answer
1k views

Looking to create a custom, graphical editor for a data model using HTML5 and SVG

I need to create a graphical editor for our data model that works in an HTML5 compliant browser. I am looking for a proper library/framework to build on. The model is stored as xml, but that should be ...
8
votes
5answers
3k views

When a task can be accomplished by either Javascript or CSS, is it better to use CSS? [closed]

I always veto JavaScript by using CSS as much as possible. i.e. I create tabs and rollover buttons using CSS rather than JavaScript. I have seen some solutions—specifically the Wt ...
0
votes
1answer
173 views

Dynamic query in Mysql

I'm doing a J2EE web application with Struts2, Mybatis and a MySQL database, so what I want to allow to the user is to be free to choose different parameters to perform a select to a table in the ...
1
vote
3answers
300 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
232 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
0answers
109 views

Using ng-init to initialize data in Angular controller

Recently I came across the following in one of our projects. In one of our mvc views they are passing model data to an Angular controller through ngInit directive In xxx.cshtml <div ...
2
votes
1answer
364 views

How can I keep Web services requests in a DAO layer without tying the code to the DOM?

I'm working on a single page application on the node-webkit desktop app platform, which means 99.9% of all of the logic is written in JavaScript. Since this is a reboot of a project we're working on, ...
0
votes
1answer
106 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 ...
-2
votes
0answers
13 views

Does the JSON parser omit empty arrays? [migrated]

I have a JSON like this: { "CODE" : [{ "FOO" : "BAR", "SET" : [] }, { "FOO" : "ABC", "SET" : [] } ] } Now, when I try to access CODE[0].SET, I ...
0
votes
0answers
12 views

JavaScript Print Formatting [migrated]

I'm learning NodeJS and rewriting some code to see how it compares. For one script, I am trying to take dates in the form of strings and turn them into JavaScript Date objects to perform calculations ...
0
votes
1answer
83 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
154 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 ...
1
vote
1answer
148 views

Web Application: Combining View Layer Between PHP and Javascript-AJAX

I'm developing web application using PHP with CodeIgniter MVC framework with a huge real time client-side functionality needs. This is my first time to build large scale of client-side app. So I ...
0
votes
4answers
174 views

Is client side JavaScript capable of replicating the Node.JS module loading system?

I like the Node.JS style of JavaScript, where I can write all of my functionalities into smaller files and then require those neatly from within my code. I'm even thinking about trying to write a ...
0
votes
2answers
103 views

Confused about javascript module pattern implementation

I have a class written on a project I'm working on that I've been told is using the module pattern, but it's doing things a little differently than the examples I've seen. It basically takes this ...
0
votes
2answers
64 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
167 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 ...