We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

Filter by
Sorted by
Tagged with
-1
votes
2answers
176 views

Why don't browsers have the ability to differentiate between events triggered via input devices and scripts ex: element.onEvent()?

Why don't browsers have the ability to differentiate between events triggered via input devices and scripts ex: element.onEvent()? Wouldn't this be a very simple way counter attack web spam bots? Or ...
-1
votes
2answers
532 views

Is it reasonable to use Javascript MVC Frameworks for closed source paid web applications? [closed]

I am wondering if it is reasonable to write closed source, paid web apps in Javascript (JS MVC Frameworks like AngularJS, Backbone, Knockout, ...)? I'm concerned because in this type of frameworks you ...
-1
votes
1answer
259 views

What's is the actual reason that JavaScript is not enough to draw? [closed]

I'm looking for a pure JS library that allows to draw the mouse trail, but I cannot find anything pure but using canvas. Is there is a reason for that it could not be achieved? I'm on the wrong ...
-1
votes
3answers
165 views

Why are framework javascripts not reutilised between pages?

As some js files are very common and widely used on the web, why browsers don't reutilise them? wouldn't it improve efficiency, as js framework files are usually heavy?
-1
votes
1answer
280 views

Javascript: Invest in ES6 or learn prototype fundementals [closed]

As a budding software engineer, what is worth time-investment in terms of Javascript? I'm interested in long term payoffs in terms of a deeper understanding of languages, tech, software engineering, ...
-1
votes
1answer
198 views

Inheritance hierarchy design approach - Javascript [closed]

For the below code, that creates inheritance hierarchy, function Animal(){ this.name = "Animal"; // toString is a function in the main Object that every // object inherits from this....
-1
votes
1answer
1k views

How should I setup a UI for editing a binary tree? [closed]

I need to allow the user to create an binary tree. I have a Backbone Model populating properly from the database, the problem I am stuck on is how do I setup the ui elements in a way that is fairly ...
-1
votes
2answers
278 views

How to process a login form data?

I have created a login form for my website, but the issue is how to process the data provided in the form by the uses. You see, I can't just write a basic function like this one - myfunction(){ if(...
-1
votes
1answer
568 views

Hosting a static website containing JavaScript/jQuery

I have customized a free downloaded web template as my simple, static website. It contains HTML, CSS, and JavaScript/jQuery. I want to make it live, and am confused from where to host it. The hosting ...
-1
votes
4answers
3k views

What exactly is the meaning of “node” in Document Object Model (DOM)?

I've searched for the definition of a "node" in a programming language and I am still finding it hard to understand. Could anyone advice me in simple, layman's terms: What is a node?
-1
votes
2answers
2k views

Whats the best way to build a HTML/AJAX site that requires login? [closed]

Let's say that hypothetically you wanted to build a website that delivered content to the visitors entirely using HTML and Javascript (AJAX to fetch server side data). The site would require login for ...
-1
votes
3answers
160 views

Writing elegant promises in Node.js

I am having a real difficult time writing some clean code with a simple user registration/login manager. I am trying to stay out of nesting/callback hell, and am also not seeing any benefit in using ...
-1
votes
1answer
112 views

Javascript: Effect of passing entire object vs a property of the object as argument on performance

Does passing the entire object as argument rather than just a property of it, in javascript, effect performance? For example: <input type="button" onclick="getDetails(this)"/> vs <input ...
-1
votes
2answers
406 views

How are complex programs made? [duplicate]

I know a few languages, and can program in them. How do multiple languages blend together in a single program? For ex. https://github.com/facebook/watchman. This uses C, PHP, Python, Javascript, etc. ...
-1
votes
1answer
121 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 = [ '...
-1
votes
1answer
161 views

What do I need to know re. Javascript frameworks? [closed]

I recently asked this question on SO, which quickly became downvoted and closed. Clearly I lack a deeper understanding of JS, which I'm hoping you'll help me fill here. I'm a perfectly capable web ...
-1
votes
2answers
579 views

Where can I learn more about JavaScript and Python? [closed]

Been teaching myself how to code over the past four months or so -- mainly in JavaScript, but just started Python -- and had a revelation today. I can write in JavaScript pretty well, but I don't ...
-1
votes
1answer
349 views

Javascript Form Validation

When validating a JavaScript form, would it be better to process each input field individually, or, where possible check collectively? e.g. validate() { noblanks() fieldOne() fieldTwo(...
-1
votes
1answer
90 views

Is it a bad idea to persist a javascript function?

I'm working on eventual consistency. In short I have a bunch of promises and I want to make sure they get retried until they succeed. It would make my life a lot easier if I could just persist the ...
-1
votes
1answer
55 views

Difference in use-cases for just using '.catch' v.s using 'Throw Error…' with '.catch'

If .catch catches any errors upon request attempt, why would I need to use Throw Error... with .catch? For instance, what is the throw Error used for, that the .catch doesn't handle automatically? ...
-1
votes
1answer
137 views

How can I prevent my API from being accessed by anything but my website?

I've got an API (Java + Play Framework). I've got a website (React) who has to communicate with the API. I don't want my API being called by anything but my website. How can I do?
-1
votes
2answers
699 views

How does a dynamic array access work?

In C if i declare int x[4] Which tells me its an integer array with each array element size fixed of size 4. So after initialization when I access x[3] : address of array +element size which is 2 *...
-1
votes
1answer
4k views

How do I remove all instances of a key from a JavaScript Object? [closed]

I've got a Java Script object like this: let obj = { selected; true, level1: { level2: { selected: true } } level1: { selected: true, ...
-1
votes
1answer
151 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 non-...
-1
votes
1answer
644 views

Twitter Bootstap: Backwards compatibility? [closed]

I work for a university Digital Services team. Our university's main website uses the Ektron CMS (I have my own thoughts about this, but that's irrelevant). Because we maintain a university website, ...
-1
votes
1answer
600 views

Which Ext JS license should be acquired (when developing a Spring MVC/Hibernate/Ext JS web application)? [closed]

I am inquiring about a web app which uses Spring MVC and hibernate on the server and ExtJS 4 (Sencha JavaScript framework) for the client framework (widgets). The app is cloud-hosted - it is not "...
-1
votes
1answer
2k views

Can the JSF 2.0.0 code be converted to JavaScript/HTML5?

I am developing an application using WebSocket to exchange messages; it is based on JSF 2.0.0, but the idea is similar and HTML5 have WebSocket support. Is the only difference between those ...
-1
votes
2answers
90 views

Notify thousands of clients with websockets, are there any caveats?

I'm building a web app, where users can create locations, which are displayed on a map. Also, users can click on the map objects in order to get to a place details page where further interactions ...
-1
votes
1answer
82 views

Would I need a web framework if the app is running locally and not in the net?

I need to make an Employee Payroll application and the client specifically stated that the application will run on their computer locally and will not be hosted anywhere in the internet. I can code ...
-1
votes
1answer
120 views

What options are for a GUI for a Java application? [closed]

This might be a bit of a wide question. I have a couple of classes in Java that take input a String which is a mathematical expression and evaluates it. I want to implement a desktop GUI for this. ...
-1
votes
1answer
163 views

Is it bad practice for a composited instance to reference its parent? If yes, why?

I'm building a Selection class that holds and allows manipulating selected Items on a canvas. The Selection is part of the Document, the top-level app-container if you will. I'd like to be able to ...
-1
votes
1answer
87 views

How to develop larger client-site in-browser apps in javascript?

I'm new to javascript environment (I have background in C++ physical simulations and game engines). With rise of HTML5 and WebGL I was thinking I'd like to try make some games/3D editors using ...
-1
votes
1answer
304 views

How to extract SSML parsing code of espeak to implement SSML parsing at SpeechSynthesisUtterance?

eSpeak implements SSML parsing. SpeechSynthesisUtterance, at least as implemented at *nix, does not parse SSML input at Chromium or Firefox browsers. How to identify and extract the relevant portions ...
-1
votes
1answer
177 views

Modelling research paper data in JSON

I need to design an UI to edit a research paper, I don't have enough knowledge about the research domain but still I tried to do my best and thought to design a normalized schema. I am describing the ...
-1
votes
1answer
99 views

Javascript Closures to Separate Class [closed]

PROBLEM: In Javascript I use closures to encapsulated methods inside a class. It helps building hierarchy inside and minimize amount of methods at root, but they become lengthy. RESEARCH: Applied to ...
-1
votes
1answer
168 views

Short Circuit Execution [closed]

Modify the car painting example car.color = favoriteColor ||"black"; so that the car is painted with your favorite color if you have one; otherwise it is painted with the the color of your garage: ...
-1
votes
1answer
110 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 ...
-1
votes
1answer
412 views

What kind of JavaScript design pattern is this?

In our workplace we use simple ajax library for getting page data and submitting changes to the server. Sometimes we need to change the form’s field values. We know that fields can be of any type (...
-1
votes
1answer
135 views

Is there a way to input values on a web site's text box using a database table values?

I have a table with username and passwords that I want to input in Hotmail's username and password box. Is there a way to actually program this? Are you allowed to manipulate text boxes of someone ...
-1
votes
1answer
163 views

Has anyone collated a comprehensive list of all the prototype-programming style javascript work? [closed]

I'm looking for a comprehensive (or as close as possible) list of all the prototype-programming style javascript work done to date. Does anyone know of such a list somewhere, or have the knowledge to ...
-1
votes
1answer
265 views

NodeJS SocketIO Multiplayer Multiple Game Room Management

I am making a multiplayer card game and am using NodeJS as my server with SocketIO. My question is how should I be managing multiple game rooms (say an n number of game rooms) ? Currently I have it ...
-1
votes
1answer
35 views

Tools for generating a form from a schema, and applying process flow logic

We have a situation where the business has a range of datasets which end users contribute to. The business needs flexibility in adjusting or rather extending these datasets, and also publishing new ...
-1
votes
1answer
771 views

coding practices: return vs else [closed]

Which coding style is considered better practice? if-return: function fn { if (condition) { /* if true: insert code here */ return; } /* ...
-1
votes
1answer
151 views

Design ideas for showing another website's page in my own website

I would like to show a web page from another website and show it on my website. I want to annotate some text on their website content. Conceptually I know what needs to be done: - I will capture their ...
-1
votes
2answers
740 views

Consuming Web API in website with role based views

I understand Web API. I understand websites, how they call a web API and all the good stuff. My question is, how do you control the user view in the website consuming the API, based on the API ...
-1
votes
1answer
3k views

How to get machine client information from web application?

I am writing a ticket system in PHP(with Laravel) for about 350 users and around 200 machines. I know that already are good solid solutions available, but I'm doing some very useful projects to learn, ...
-1
votes
1answer
326 views

I'm building an app with Node, Express, and MongoDB. Is AngularJS necessary?

Node, Express, and MongoDB are really connected so I can understand why they are frequently used together. For a web app of medium complexity, can I get away with only using HTML/CSS and EJS for the ...
-1
votes
1answer
188 views

Where does Firebase fit in?

I am a front-end developer who is familiar with HTML, CSS, JS and to a degree, AngularJS. I've chanced upon Firebase (firebase.google.com) - and was wondering if I could, with my lack of knowledge ...
-1
votes
1answer
287 views

Strategy To Upgrade Frontend Javascript Code - Typescript or New Framework?

Here is my scenario. I would like advice on which path to follow, along with good reasons as to why. It would even be better if you could give an example based on experience of a similar decision but ...
-1
votes
1answer
4k views

How to incoporate jQuery UI into ASP.NET MVC 5 project that is on an offline system? [closed]

I am having some issues trying to incorporate jQuery UI into my project. I cannot use Nuget or anything else that goes to the internet, so I have downloaded the development package from the jQuery UI ...