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)

2
votes
2answers
74 views

Javascript Password Security

I'm extremely new to javascript (so I know there's already a thread here), but I couldn't understand how to implement it. My code is pretty much identical: <script language="javascript"> ...
-2
votes
0answers
8 views

Best Way to join reactjs and cakephp without v8js or nodejs?

Hello i have some experience using cakephp but i really don't like the way the ui is handled, so i look at reactjs from facebook (Called as the View of MVC) and it looks like an standard good to ...
-4
votes
0answers
32 views

Best resources for beginning front end development? [on hold]

My husband is interested in learning how to code. He is currently getting a degree in Psychology and isn't sure if he'll find a good career out of it so is considering being a developer as a fallback. ...
0
votes
1answer
24 views

Is it possible to use on focus event on form..?

I tried to find when and on what onfocus works.. Can some one tell me is it possible to trigger event when some one is viewing current form ?? I know it works on input,dropdown and textarea.. but ...
-2
votes
1answer
43 views

(New Programmer Alert) As I'm learning Javascript and Jquery What Else Should I learn? [on hold]

I'm a new programmer and kind of over whelmed by all the other awesome stuff there is to learn. I've gotten HTML and CSS down and now want to make my websites more interactive. I know with Javascript ...
-3
votes
0answers
16 views

How to pass input text box value from previous page to input text box in the new page with Javascript? [on hold]

Any help appreciated.. I have been stuck on this for a while.. Right now once it gets the searchVal from the old input text box, it redirects to new page and then stops doing any javascript after ...
-1
votes
0answers
18 views

upload a file to sql server and download it from sql server in asp.net mvc web api using knockout js [on hold]

I'm very new in asp.net mvc web api (APIController)and knockout js but i want to upload a file to sql server and download it from sql server in asp.net mvc web api using knockout js , i'm looking for ...
-2
votes
0answers
8 views

Problem with device orientation code in Firefox for Android

The following code is supposed to make a map on a web page be the only element that is displayed on the page when the phone is turned sideways, and then re-adds the other elements when the phone is ...
2
votes
6answers
635 views

Replacing C with JavaScript as an introductory programming language [on hold]

I am a new teacher at polytechnic where we teach web development and basic software programming. For years, the institution where I teach have taught C as their introductory programming language to ...
0
votes
2answers
54 views

Using PHP without mixing presentation logic

I'm conceptually designing a website / application and trying to come up with the correct separation of concerns. The basic technologies I'm settling on are: MySQL, PHP (Laravel), HTML/JS (jQuery). ...
3
votes
2answers
67 views

why regex, when using global search and {0,} quantifier, match the end of the string?

I have asked a question here about js, regex, quantifiers and global search. I've understood finally how this works, but, let's take a concrete example and then I`ll write my question. Based on the ...
2
votes
3answers
178 views

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard ...
0
votes
0answers
40 views

Vertical Single Page App libs/patterns?

Lately I've noticed a trend amongst some website homepages to present information in a vertical fashion, forcing the user to scroll down to continue reading the content. As you scroll down, a state ...
0
votes
0answers
57 views

How to use a href link just like a button? Which can perform some event? [on hold]

I need the help in web programming concept. I want to create a link which will perform a login redirection. I want a reader view which will display some information To perform login we have to open ...
-4
votes
0answers
76 views

Javascript entry-level interview [on hold]

I like to program and have been in pursuit of a developer career. I have some basic knowledge in most programming languages out there like C++, C#, Java, PHP, Python, etc. I also know HTML/CSS and ...
0
votes
0answers
36 views

Nested website navigational menus [on hold]

So, I have created a website that has a navigational menu made up of nested unordered list elements. For example, <ul> <li>Home <ul> <li>About Us</li> ...
0
votes
0answers
18 views

dynamic api code generation in nodejs

We are using nodejs and cassandra for backend stuff. In past few months we wrote same CRUD code for different apps. I am thinking of some way to automatically generating CRUD code. I came across ...
2
votes
1answer
143 views

What would be a reason not to embed JS in C? [on hold]

I'm working on an opensource application that processes JSON in C, because I would like to make it easier for people to help me in the project and because JSON is so close to JS. I want to embed a JS ...
1
vote
1answer
71 views

Which JavaScript Template (jst) syntax uses double-brackets, (e.g. [[ and ]] )?

I'm looking at the source code for a Rails application that uses Backbone and there are template files with .jst.ejs extensions. The templates include HTML with lines of JavaScript wrapped in ...
-5
votes
0answers
29 views

copy and paste from text box to text box [closed]

you can make a little program that copies the text of a text box on a web site?. I refer to the email address temporary guerrillamail. and to pass this argument to another text box to another website? ...
0
votes
0answers
43 views

JavaScript: How future-proof is using the onpaste event? [closed]

I've been building a jQuery plugin which, along the way, required me to handle the user pasting a value into an <input> element. I've handled this by using the onpaste event. However, ...
0
votes
1answer
46 views

Is there a relationship between a data source (JSON) and the Model that consumes it?

I have put together a large quiz data structure. It is in JSON format but I guess it could be XML etc. It may look something like this simplified: { "quiz":{ "title": "Welcome to Quiz" ...
-2
votes
0answers
29 views

Angular service with different angular app [migrated]

Here i am using angular service.In my case i am getting value for first app but not for second .please help me . thank you. here is my html:- <div ng-app="mainApp" ...
0
votes
2answers
80 views

How can I show and hide a single field across my web application through a checked value?

Let's say I have a field called "FooName" and I have "FooName" in several places across my web application (ASP.NET MVC4). I have a check box that allows me to turn "FooName" on and off across the ...
-1
votes
0answers
5 views

D3 show segment of series data [migrated]

I'm looking for advice on how to tackle the following chart in D3.js: I have data in the following format for the 7 series shown Learning Disability AgeBand | Percentage 0-4 | 0.02 5-9 | ...
4
votes
1answer
190 views

Is localStorage under The Cookie Law?

I'd like to avoid having the cookies banner on my websites where possible. Could I store session id's in localStorage to bypass implementing the banner?
1
vote
1answer
50 views

Does requestAnimationFrame() really align with monitor refreshes?

Take this code: requestAnimationFrame(function (timestamp) { console.log('one', timestamp); }); requestAnimationFrame(function (timestamp) { console.log('two', timestamp); }); // logs: // ...
0
votes
1answer
222 views

Is writing code chronologically the best way for readability? [closed]

So I've been writing a lot of JavaScript lately. Despite what many people say I think JavaScript can be a simple and beautiful language. What I've pondered of late is how to structure the code so it ...
0
votes
0answers
57 views

Why does a lot of Angular source code avoid enclosing the contents of a file in a closure?

I am assuming because it is a standard practice in the Angular world that, any sort of module system has to be wrapped as an Angular module and angular should be the only global variable used which ...
1
vote
1answer
62 views

The difference between bind and _.curry

So JavaScript's bind supports currying, but most people use some other library like lodash or ramda to do currying. From first impression It seems like bind supports context changing, since that is ...
0
votes
0answers
23 views

JavaScript top and left positions not working? [migrated]

I have this code in JavaScript on a html file but when i run it the image that i have doesn't move when i change top or left. Why is this happening, i have been searching for hours and copying tones ...
0
votes
1answer
51 views

Should the server and client portions of an SPA be separate repos? [closed]

I'm building an SPA (my first), and I had a question about organization. (I'm using Node.js for the server and Browserify & React for the client, and that's mildly important later). I'm unsure if ...
2
votes
0answers
44 views

Mapping different XML and CSV feeds

Not sure if this is the right venue to be asking this but here goes. A little background. I'm trying to build an ecommerce app that would allow sellers from other venues--like, amazon and newegg--to ...
2
votes
0answers
99 views

is this a valid javascript design pattern when many instances are required?

I have some code that I'm refactoring, right now its just a list of functions, primarily jQuery. The code is a form builder. The user adds sections, questions etc using jqueryUI drag/drop/sort. They ...
1
vote
1answer
106 views

What is the name of the pattern for passing an incomplete object to a constructor? [closed]

Several times in javascript I've seen a constructor function take in one parameter. The constructor will initialize all the fields for the object to default values and then use the parameter to ...
2
votes
5answers
266 views

Securing ajax calls to rest api

I need for my app to consume a rest api service and since I will call it from javascript/jquery i need to expose it to the end user. In this case I would also need to expose credentials to the end ...
1
vote
1answer
62 views

Best place to declare functions in this example

Suppose I have code that accepts html GET requests: server.get('path/to/some/endpoint', function(req,res) { function a() { //function goes here } } Is it better to declare functions ...
0
votes
2answers
113 views

The correct way of declaring & instantiating variables ( Javascript ) [duplicate]

I have seen other peoples code and each person has a different way of declaring variables. And I have been told by quite a few people that declaring variables in the Global Scope is wrong. My ...
0
votes
1answer
96 views

Switching over to the real ES6 / ES2015 [closed]

It is exciting time of having Babel and being able to use all nice nice features. It got me thinking, what happens in the future? Nobody really talks about it. I mean some browsers would eventually ...
-1
votes
1answer
46 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: ...
4
votes
0answers
219 views

When to use Prototypes & the correct usage of Prototypes ( Javascript )

I have been programming in Javascript for a while and I am quite comfortable with it. And I know the basic concept of prototypes and I have also used them a few times. But one thing I can't figure out ...
3
votes
1answer
104 views

Importing plain javascript libraries in an AngularJs application

I am working on an AngularJs project which is getting bigger very fast. Currently I need to store some user data, so I was using $localStorage for Angular. But I had a problem, as the application is ...
-1
votes
0answers
26 views

Changing CSS Div Position Value Given in % Using Javascript [migrated]

Changing CSS Div Position Using Javascript I am really new to javascript, and I have searched for an answer to my question to no avail. I want to be able to click a button and change a div value ...
3
votes
1answer
106 views

Using a rules engine to manage client and server side validation of business rules?

Has anyone managed to use a common rules system between their frontend and backend? Similar to this question: Managing client-side and server-side validations in one place, I'm trying to find a way ...
1
vote
2answers
80 views

Where to declare event handlers: Markup or Script?

If the event handler is declared in the markup, it'd be (kind-of) adding presentation logic to HTML. <button id="btn" onClick="foo()">Click Me!</button> If the event handler is declared ...
0
votes
1answer
37 views

What is the difference between web components and custom elements?

"Web Components" and "Custom elements" are often mixed up, and web searches for the title of this question don't yet produce much clarity. Let's fix that.
47
votes
7answers
5k views

What is the actual value of a consistent code style

I am part of a consultant team implementing a new solution for a customer. I am responsible for the majority of code reviews on the client-side codebase (React and javascript). I have noticed that ...
2
votes
0answers
79 views

Preserving data in js with multipage application

One benefit of single page applications like Angular.js, is that you can store data in a global variable and access in multiple routes. With multiple page applications, the data is lost during ...
0
votes
4answers
270 views

How can I keep browser URL secret when editing data?

Suppose, There is a user list. <a href="user/5">Edit</a> <a href="user/6">Edit</a> When a system user clicked to edit a user info. Then it goes to url to browser like as ...
0
votes
0answers
4 views

Styling of charts externally [migrated]

Is it possible to translate(detach) bar colors stated in js file to separate css stylesheet. How to assign classes to this values? /* Bar dashboard chart */ Morris.Bar({ element: 'dashboard-bar-1', ...