JavaScript (not to be confused with Java) is a dynamic, weakly-typed language used for client-side as well as server-side scripting. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script). Unless another tag for a ...

learn more… | top users | synonyms (12) | javascript jobs

0
votes
0answers
6 views

How to use Angular ng-style

I'm trying to set a image to a div with ng-repeat and works fine with other elements in my array but not with the image <div ng-app="myStoreApp" ng-controller="myCtrl"> <div ...
0
votes
4answers
10 views

Escape “” characters to enter variable in jQuery

I am sure this one is staring me in the face. Trying to increase the rotation on an object until i reaches a value. Getting an error as I am trying to escape the CSS part to enter my variable 'i'. ...
0
votes
0answers
6 views

Global variable is a reference to a variable returned from a function — bad practice?

Trying to avoid global vars, but I need to share a variable(integer) between two functions that are not nested. Both functions are declared directly under the global scope. Is something like this ...
0
votes
0answers
7 views

React timer hanging on :00 (state not updating)

I have a basic timer in React functioning properly counting down. The only problem is that it keeps hanging for an extra second (or two) when the timer's seconds reach '00' before switching to '59'. I ...
1
vote
1answer
6 views

Show textarea if selected item in listbox changes

I have a listbox, and I want to show a textarea if I have a selected item, it is so simple, but my code isn't working, can any one help me? Listbox code : <select onchange="change(this)" ...
0
votes
0answers
4 views

How can you put offline localstorage into MySQL with PDO/Mysqli?

I can store an image on localstorage. I would like to be able to upload an image from localstorage to MySQL. How would you pull this data and go from localstorage (or Sqlite) -> to MySQL (with ...
0
votes
0answers
3 views

Getty Images - Constructing a request with Angular

This is the very last part for a tech test I am doing with a company and would love to learn how to do it. I'm new enough to Angular (and linking from JSON). I've been given a challenge to get ...
0
votes
0answers
3 views

AJAX requests are being cancelled after HTTP_STREAM_PARSER_READ_HEADERS

My XMLHttpRequests are being cancelled, yet still seem to successfully work (data gets to the server). Another question recommended looking into the chrome events for a reason, it seems to cancel ...
0
votes
0answers
10 views

adding getElementsByClassName loop

I am currently having a little trouble implementing getElementsByClassName into some code that is used in my website. I needed to get away from using Id tags on Variable D. Though I don't think I can ...
0
votes
0answers
12 views

drawing a bar in js that visually displays var number values (-50 to +50)

I'm working on a project that has 8 variables that can go to -50/+50 each and they are currently displayed as a number, but I am looking to snazz it up a bit with a visual bar that adapts on page load ...
0
votes
1answer
11 views

RegEx for “predicate syntax”

/^[a-z][ ][=][>][ ][a-z?][.?][a-z0-9]+[ ][=][ ]['?][a-z0-9]+['?]]/i I'm trying to figure out how to get a rexex pattern that would recognize a string of predicate syntax (used in c#) In the ...
0
votes
0answers
5 views

Android: Uncaught TypeError: Object function Array() { [native code] } has no method 'from'

My WebView using a html file and a button calling getTopRow() javascript method from the html file. The method working on jsfiddle: (https://jsfiddle.net/efgpx4o9/1/) but android studio throwing ...
1
vote
2answers
15 views

Printing each value of an array on a separate line Javascript

I have a program that involves Javascript to allow for interaction with a webpage. It's a baseball site so what I am doing is prompting the user to enter a month. The user can enter a number, like 6 ...
0
votes
0answers
3 views

Highstocks API - How to plot a chart for a company other than AAPL?

There is a demo in here from Highcharts for APPL. I have a JSON for a different company from MarkitOnDemand API and want to replicate the same chart as above. What parameters should we change for ...
0
votes
1answer
11 views

Javascript RegEx: Get 1 or 2 digits after a symbol (Excluding that symbol)

Thanks in advance for taking a look at this. I'm having some difficulty extracting something to create a sports project. I've got the following situation: lastName, firstName #33 6 Which works ...
1
vote
2answers
20 views

Create links inside a list

I have a list looking like this <li class="list">text1</li> <li class="list">text2</li> <li class="list">text3</li> and want to make the text to links, with this ...
0
votes
0answers
3 views

SQLite for Ionic returning error

I'm using Firefox and Chrome for development. I installed the sqlite plugin but there's always error when firing openDB command on: firefox(TypeError: n.sqlitePlugin is undefined ng-cordova.min.js ...
0
votes
1answer
9 views

Prevent multiple clicks while animation is ongoing (stopPropagation & :animated)

I am asking after reading and following these answers. jQuery prevent multiple clicks until animation is done how to prevent click queue build up, using toggle in jquery? tried using ...
0
votes
0answers
16 views

How to delete a array value into a resource?

I have the next service: function Lawyer($resource, BaseUrl) { return $resource(BaseUrl + '/lawyers/:lawyerId',{lawyerId: '@_id'}); } Then, in my controller, I have the next code for delete a ...
0
votes
2answers
14 views

javascript update when screen resize

I have some javascript being used which allows my nav's background to change colour dependent on how much the user has scrolled down. This works completely fine, however I am having an issue in ...
0
votes
0answers
7 views

How to make part of the document not reactive in Meteor

Most of the Meteor revolves around collections and cursors and fetching new documents when they appear in collection and match the criteria. Yet I am working with bigger documents, that contain ...
-3
votes
0answers
17 views

My html5 Javascript website works when viewed using a chromebook but not on windows chrome, how can I fix this?

This is my website http://animated-mathematics.net/ There are lots of buttons and sliders, could there be issues with on-click events? I have not created the website using dreamweaver or something ...
-2
votes
3answers
28 views

How to replace every x-th occurence of a string in a text with RegEx?

A sample text is "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", "abc", " where abc could be every ...
0
votes
1answer
16 views

JS: Access function from enclosing scope?

I'm more used to Python, so the CJS/Browserify stuff might be a red herring; I might be thinking about this wrong. But I'm not sure how to google this. So, I have two JS files for use with ReactJS. ...
0
votes
0answers
6 views

Aligning image to the center of a google-map div

I am trying to align an image to the center of a google map div. Basically this image is to apply the same functionality as Uber. as in having a floating marker that is always aligned to the center ...
0
votes
0answers
11 views

Saving Nested Data Before Parent is Assigned an ID

I have a Resume model and an Education model. Education belongs_to resume and resume has_many educations. I'm currently using a form in Resume's show.html.erb view to enter data for educations just to ...
0
votes
0answers
16 views

Can't find bootstrap file in Angular app

I'm building an Angular on Rails app following a tutorial. I'm having problem with front-end dependencies in Rails project. I installed bower and sprockets to install the dependencies like following: ...
2
votes
1answer
22 views

jQuery scrolling force won't scroll more than 450px

//Scroll Status abfragen} $(window).scroll(function(){ var wScroll = $(this).scrollTop(); $("#vor").click(function() { if(wScroll < 450) { $('html, body').animate({ ...
0
votes
0answers
28 views

Something wrong when requiring file

I have the following 2 files, first Physics/world.js: var p2 = require('p2'); var pkg_world = require('../redis_pkgs/pkg_world.js'); var redisObjectMap = new Array(); // redis_id - world_id var ...
0
votes
0answers
6 views

Angular and Express routing with html5mode enabled

So my question is: how could I make angular and express routing work together with html5mode enabled? When I change state from '/' to my admins state I get list of all admins and everything is fine ...
0
votes
0answers
9 views

Star twinkling background animation and webgl canvas ripple effect

I want to create a twinkling star background - same as in this tutorial: https://www.script-tutorials.com/night-sky-with-twinkling-stars/ It uses image with black dots repeated over the area and ...
0
votes
0answers
8 views

Google maps Direction.Route Query Limit Exceeded

So I know the general issue of directionServices of not to exceed the 10 calls. But Im really trying to figure out what I can do as an alternative. Right now I am using a for loop as so, ...
0
votes
1answer
11 views

Set active item in owlCarousel

I have a owl carousel with 3 items, the carousel displays one item per page. Inside each item I have html inputs. I want to programmatically change the active item so I can make focus on input inside ...
0
votes
0answers
7 views

Facebook not giving access to global javascripts objects like window or document

I am making a chrome plugin that needs to be able to have access to javascripts document object but it seems like Facebook has disabled or removed them. I try to open devtools and type window or ...
0
votes
0answers
15 views

Connect 4 Javascript/jquery not working

Having issues with my js/jquery code for my connect 4 game. Any advice would be appreciated. This is for a project for a web dev 100 bootcamp I am currently in. // Jquery and Javascript for ...
1
vote
1answer
19 views

Javascript get file contents loop

I have been trying to get a function to reload every second. I can do this with php get file contents (and meta page reload) but I am also using JS to display time and its not instant at loading so ...
-1
votes
0answers
8 views

Dropdown menu show behind of menu div in wordpress Gantry 5

My dropdown menu not show correctly. Please check this site Look "Kursna lista" and "Kontakt" Thanks
0
votes
2answers
20 views

Stating a Node.js project: Is there only one “server file” in node.js?

I'm in a team project, and my team is slacking, so I'm going to take the lead and start off the repository. We are all new to node.js and come from other backgrounds. There is only 1 "server," right? ...
0
votes
4answers
18 views

How to compile javascript files into one?

Let's say I have 2 files! base.js base = function(...) { .... } file1.js base.function = function(.....) { .... } How could I compile them into a one file? Does it require requirejs? ...
0
votes
1answer
17 views

Drawing on HTML Canvas with a Mouse?

I'm trying to play around with HTML Canvas now. Can someone tell me why this JFiddle is not working properly. I know the code is correct, but it's not properly displaying. I'm assuming its ...
0
votes
3answers
38 views

Javascript Nested for loop with ES6

I guys, I have a nested for loop but I want to do it with an Array map/ES6 way but how does that work with nested forloops? for (var i = 0; i < enemy.ships.length; i++) { for (var ...
0
votes
1answer
22 views

Displaying results of multiple API calls

I am making two API calls to a backend server and I am using the following approach to display both responses in json to the user. However, alert 2 is 'undefined' according to console; and alert 1 ...
0
votes
0answers
5 views

Meteor + React + Redux + React Router

I have used Meteor with Blaze and Iron Router in the past, however that was a long time ago and I am looking to use the above technologies (Meteor + React + Redux + React Router) to start off a new ...
0
votes
0answers
2 views

How to ignore extra spaces in LDPA search filter?

I have a node.js application that accesses AD through LDAP I have a filter that looks like this: filter: '(name = ' + inputString); Where inputString might be a name that looks like 'John Smith' But ...
2
votes
1answer
49 views

Hidden div in a li tag

I have a menu icon. When I click on the search icon, a hidden input form appears for the search. The problem is that when I click on the icon the form slides fast on the right but the icon image goes ...
0
votes
0answers
8 views

Why are my d3.js svgs appearing out of order?

I've got a series of pages that are each arranged as such (sample code is below): <h3> element with <p> text Dropdown menu d3.js linegraph <h3> element with <p> text Table ...
0
votes
0answers
3 views

How to initialize fullcalendar with 'stick' eventSources

I've successfully initialize my calendar using http://fullcalendar.io/docs/event_data/events_json_feed/ but cannot set my events as 'stick'. I know I can use ...
0
votes
2answers
11 views

FormData() object is always empty in Django backend

I am trying to upload an HTML form via AJAX (just JS, no jQuery). The form is assembled by my template by adding three components: The csrf token, a ModelForm and a regular Django form (forms.Form). ...
0
votes
0answers
5 views

How to send the events array from fullcalendar to a servlet? [duplicate]

I need to send to the servlet all events stored in the 'fullcallendar memory'. I know yet that fullcalendar has a callback that returns the array of all events: ...
0
votes
1answer
10 views

dd display style changing to none

I have a dl but when I run it, the dd elements work properly when dt is first clicked, but then the dd style's change to display:none, and I'm not sure why. How do I keep the style from changing? I ...