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

0
votes
0answers
13 views

Reasoning behind indexedDB versioning

So, the last 2 weeks I have been fighting with indexedDB and one of two recurring questions that keep popping up is why indexedDB has to use/present it's entire versioning system? I do understand that ...
-4
votes
0answers
30 views

Java uses or overides depreciated API? [on hold]

I have written code for my project and I get this warning message when I compile. I cannot run it. Please help me. below is the code import java.awt.*; import java.io.*; import java.util.Vector; ...
3
votes
2answers
110 views

secure photos on server

I would like to hear advice from the more experienced developers. The project is now in the design stage. It's mobile application and a simple web application. Content is pictures, comments, personal ...
-2
votes
1answer
91 views

Why is an A element often used instead of a BUTTON for web design? [on hold]

Is there any particular reason why people use the A tag to mimic a BUTTON in HTML and JavaScript?
0
votes
0answers
24 views

Keeping Backbone model in sync with editable view

I'm making a web form for editing some objects. I'll call these objects Foos. I have a Backbone model that represents Foos. I have a Backbone view that renders an editor form, filling in fields ...
-2
votes
0answers
62 views

Implementing a lazy-loaded list [on hold]

I've been trying to implement a lazy-loaded list in HTML, my first approach was a pagination system: Each page was as long as the screen length. User starts to scroll down/up Next page would be ...
-2
votes
0answers
95 views

Are there risks that javascript frameworks and libraries break due to browser updates? [closed]

We've started using Angular JS in developing a core in-house application. We've decided to support running the web application in Google Chrome only. We've been completely satisfied with using Angular ...
-2
votes
0answers
119 views

Strategies to be more effective at programming in dynamic languages

I have a strong background in Java, which obviously is statically-typed, and type-safe language. I find it that I am able to read through large amounts of code very quickly and easily assuming that ...
5
votes
3answers
350 views

Is there a web-specific reason for the design choices behind the JavaScript language?

With the advent of "the web is the platform", JavaScript is fast becoming the most widely used programming language in the world. However, many tasks that are easy to accomplish in other modern ...
-1
votes
2answers
94 views

I want to improve my java, what books, frameworks, modules should I look into to improve my java? [closed]

I've been coding with java for 1+ year; mostly dealing with web applications(servlets, json, javascript). I like web development and I want to improve myself, instead of whatever I've been working on. ...
-2
votes
0answers
31 views

Changing the gmail attachment icons [closed]

I've noticed that some extensions from the webstore in Chrome, change the icons for filetype attachments in Gmail. I've been able to replicate that as part of a project to medium levels of success. ...
-3
votes
0answers
52 views

javascript getElementByTagName [migrated]

The question is to create a function showLink() which has a variable sIndx that points to the index of the selected option in the current selection list. <select name="executive" ...
-2
votes
0answers
25 views

Opinion about logistics and time required to build a chat room using ajax, php, javascript and mysql [closed]

Suppose, you were asked to implement a chat room with the following features : -Frontend made of HTML and CSS. -All the communication with the server is to be made through AJAX i.e the page ...
0
votes
3answers
126 views

Adding object properties using functional programming

I am currently learning functional programming using Underscore.js. What I want to do is add two co-ordinates together. Let P1 = (0, 0) and P2 = (1, 1). Therefore, P1 + P2 = (1, 1) I have a solution, ...
0
votes
1answer
50 views

Javascript design pattern with jQuery Widget factory

I am using the jQuery widget framework for creating some graphical elements on a webpage, and i have a conseptiual question about the overall structure of the code. I have 3 classes A, B and C which ...
-1
votes
0answers
35 views

Adding .Net MVC 5 script bundles on a per request basis [migrated]

Were building a widget based website that should be able to live as widgets on external sites as well. Were going to be using bundles to handle our view dependencys, as follows: In bundleconfig.cs: ...
1
vote
2answers
174 views

Multiple var statements in JavaScript

Writing a single var declaration per function is considered to be good for readability and maintainability. But, when I went through some of standard libraries, their dev version doesn't strictly ...
4
votes
1answer
184 views

Designing storage service data structure for decoupled models sharing same data

Surely most of you remember the Norton Commander application where similar (sometimes the same) data is displayed in separate decoupled views. I'm building a web application that follows the same ...
0
votes
1answer
74 views

Switch / select case etc. compared to If … ElseIf … Else [duplicate]

I don't understand why the switch or equivalent is so popular in languages. To me, it seems like it had a place back in the days when the alternative was lots of nested if statements in the else part ...
2
votes
0answers
100 views

Is there something a `Promise` can do that `async` cannot?

Recently, I've spent a lot of time trying to dive into, and understand, Javascript Promises, especially those adhering to the Promises/A+ spec. What I'm trying to understand is whether or not Promises ...
0
votes
0answers
36 views

What is special about JDBC that makes it unlikeable for JavaScript

Quoting from Selenium Architecture A natural implementation would have been to provide a database connection to the underlying data store, using something like JDBC. Eventually, we settled on ...
1
vote
0answers
63 views

Javascript Implementation Patterns for Server-side MVC Websites

I'm looking for information on common patterns for initializing and executing Javascript page by page in a "traditional" server-side MVC website architecture. A few months ago, my development team ...
0
votes
0answers
38 views

Should you implement a repository pattern with an MVVM javascript framework?

When coding a MVVM pattern I use Dependency Injection (DI) and try and code against interfaces. One of the common patterns is a Repository pattern, so I can swap my data storage provider. If I'm ...
0
votes
0answers
74 views

What do two consecutive minus signs mean in a return statement? [migrated]

In typescript, I have the following: self.newId = 0; self.GetNewId = () => { return --self.newId; }; My guess is that return --self.newId; does two things: it ...
-4
votes
0answers
50 views

Stop keyword not to be included into a string on output [duplicate]

<!DOCTYPE html> <html> <head> <script> function countWords(){ s = document.getElementById("inputString").value; var inputstring=s; ...
-4
votes
0answers
39 views

Discarding stop words from text and display only text without stop words [duplicate]

I want stop words to be deleted from my text using javascript and show only words which are not stop words my code is: <!DOCTYPE html> <html> <head> <script> function ...
-1
votes
0answers
7 views

How do you modify what keys do with fancybox? [migrated]

I am using fancybox and I would like the enter-key to perform the post action, just like the ok key. Is there are way to map the enter key to this functionality?
0
votes
0answers
11 views

Adding to script bundle from partial view in .NET MVC 5 [migrated]

We are making a .Net MVC websolution that is going to be using widgets rendered as HTML.Partials(). We would like to be able for the partial view to add its dependencys in the main page views scripts ...
1
vote
2answers
141 views

What is the applicability of CORS?

I have a system which needs to do cross-origin requests and having trouble understanding the relevance of CORS. At first glance it doesn't appear to provide me with any type of security I'd actually ...
0
votes
0answers
68 views

AngularJS: directives and controllers: resolve, loading, reloading

I have a philosophy question about AngularJS and directives but correct implementation of the next problem solves it. So, I need an AngularJS directive, It loads some data via several (not one!) ...
0
votes
1answer
97 views

Should I save a simple list cookie in Javascript or PHP?

I am currently making a simple list tool. You can click a checkbox to mark it as done and if you navigate away from the page/close the browser and reload, it will still be saved. So it's pretty much ...
0
votes
1answer
172 views

HTML markup vs programmatic JS

I've been thinking about the consequences of using programmatic JavaScript components versus HTML markup. For example I looked into the Enyo Framework, which has its power in composition. One can ...
0
votes
3answers
268 views

Finding Node.js developers [closed]

We're at the beginning stages of a new startup and will most likely be utilising Node.js as it is the most appropriate technology for the job and we like the idea of JS for both server/client. My ...
0
votes
2answers
118 views

“Match Making” script, a way without involving the database and php?

I am writing a matchmaking script for a game through a web portal. For the past few days I have been looking into the different options and I believe the following approach would be the most optimal ...
-1
votes
3answers
229 views

How to explain to layman the difference between Java and JavaScript [closed]

We all know those people, who don't differentiate Java from JavaScript. Yet when you try to explain it technically, they don't understand. Then, how to explain difference between those two languages ...
-1
votes
1answer
26 views

Concerning JavaScript prototype and the initial constructor function

I am going through a tutorial on OOP in JavaScript (javascriptissexy.com using OOP in JS: What you Need to know). The instructor is explaining the Constructor/Prototype pattern of object creation. I ...
7
votes
3answers
314 views

How to decompose / model a chessboard

As someone new to programming, I am building a chess web application in JavaScript, both for fun and to learn more about design patterns. I keep running into a wall, which is how to decompose the ...
2
votes
4answers
486 views

Call the database every time, or create an object in memory, and if so, how and how often to update?

I'm creating an app in javascript/nodejs and using neo4j as database. Let's say I have an entity User in my database. It has a bunch of properties, like boxes_collected and places_visited, which keep ...
0
votes
3answers
198 views

Are (mostly) client-side JavaScript web apps slower or less efficient?

I am in the midst of writing a web application for work. Everything is from scratch. I have been a PHP programmer for about 13 years, Node.js programmer for the past 2 years, and have no shortage of ...
0
votes
0answers
67 views

Numerous Sync/Async calls to webservice from hybrid app

I have a requirement where I have to make numerous calls to webservice to update the local database. Since I have to support lower-end Android phones also, I'm not yet sure as to how this would be ...
0
votes
0answers
5 views

How to parse data from HTML and export in Excel in PHP [migrated]

I want to read HTML table data from HTML page (without using of data base) and Export into Excel file . I am using this Javascript cede but it is not working. Please Suggest me, I am new here. ...
1
vote
1answer
155 views

When is type coercion a good idea?

When do you want (on purpose) to coerce type in JavaScript? I mean, beyond comparing strings and numbers, when does it benefit something you're building? Examples of type coercion: "The answer is " ...
1
vote
0answers
90 views

How many Angular Controllers and/or Directives is too many?

I'm building a large, editable data table with angular, and I'm trying to figure out what the best practice is. The table will be a couple of hundred rows, with a couple of dozen columns, so upwards ...
0
votes
0answers
94 views

Using Dart for Visualization [closed]

Q1. Does Dart provide any libraries for doing visualization (Something of the level of D3.js or JavaScript Infovis toolkit) ? Q2. Can I use D3.js / Javascript Infovis toolkit along with Dart ? ...
48
votes
14answers
4k views

Returning different types from one 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 ...
6
votes
1answer
552 views

Pros and Cons of Facebook's React vs. Web Components (Polymer)

What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)? According to ...
-1
votes
2answers
99 views

DMCA as a license for closed-source javascript code [closed]

I have a proprietary project, with parts of it written in javascript. We would like a software license to include in the header file for this code which ensures the work remains: proprietary ...
0
votes
3answers
307 views

Building web apps in server-side vs client-side vs hybrid? [closed]

There are currently multiple approaches for building web applications: 1. Server-side only This is a classical approach where you render pages on the server by a web framework like Ruby on Rails, ...
0
votes
2answers
133 views

How to remove redundant code that enables button. Or “if” statement

I got probably "micro optimization" problem. I got "History number", "Next Number", "Reset" buttons, as well "label" for text. Every time I click At "Next number" button I would like to show random ...
10
votes
4answers
583 views

Is there a better way of writing unit tests than a series of 'AssertEquals'?

Here's a basic example of what my unit test needs to be, using qunit: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> ...