Different uses of the % sign in JavaScript

so I'm trying to take a simple slider apart to learn from it but I'm boggled with something and can't seem to find the answer: var slides = document.querySelectorAll('#slides .slide'); var currentSlide = 0; var slideInterval = setInterval(nextSlide,...
more »

2017-08-13 23:08 (2) Answers

Ionic 2 / Cordova: Plugins Not Found

I seem to be having an issue with all Cordova plugins that I am adding to my project. For this question, I will reference specifically the SplashScreen plugin. The process that I take when building my project for IOS is as follows: ionic cordova p...
more »

2017-08-13 22:08 (0) Answers

Uncaught TypeError: getFullYear is not a function

I keep getting the error "Uncaught TypeError: date3.getFullYear is not a function" I have a date variable in both SQL and JS format (passed from another function as arguments): min1 - in SQL format. [Like - '2017-08-13 0:0:00'] mindate - in JS form...
more »

2017-08-13 22:08 (1) Answers

Validate city combination in google geolocation

I want, using Google geolocations, to validate the input that a user may have entered (as it is possible to type something that is wrong). So, given the following parameters, I would like to know if there is a valid combination: political administra...
more »

2017-08-13 20:08 (0) Answers

JsLint say Unexpected 'var' and for

The JS code is: var pElement = document.getElementsByTagName("p"); var pElementLength = pElement.length; for (var i = 0; i < pElementLength; i++) { pElement[i].className = "bodyCopy"; } JsLint say: Unexpected 'for'. for (var i = 0; i < pE...
more »

2017-08-13 19:08 (0) Answers

Non-RESTful login and passing JWT to ReactJS app?

Our ReactJS application will be using JWT (JSON Web Token) for all the REST operations, but the login page is non-react based, so I am curious as to an appropriate way is to make a JWT available to the application, that takes into account security co...
more »

2017-08-13 17:08 (0) Answers

codewar challenge javascript

I hope everyone is having a good day. This is my first ever post on Stackoverflow! I have just completed the javascript course on codeacademy and have read a couple of books on it too. Now I am on codewars. I would classify myself as a beginner in ...
more »

2017-08-13 16:08 (5) Answers

repeat div element n times

how can i duplicate a div so there n copies using javascript or jquery this is the HTML div : <div id="Guest_details_and_servicesDIV" style="background-color: white;min-height: 128px;display:none;"> @{ ...
more »

2017-08-13 15:08 (1) Answers

Sort points in counter-clockwise in javascript

I have a set of points introduced into a canvas: My canvas with set of points I have to apply this algorithm on: Algo NoObtuse and example of graph produced by this algo My problem is to find, starting from the rightmost point, the following point ...
more »

2017-08-13 15:08 (1) Answers

Generate Ranking with combination of strings

I have inputs like : var a = [23, 45, 21], b = [45, 23], c = [21, 32], d = [23], e= [32], f= [50, 54]; These all are separate entities and can be passed only one array at a time. i.e generateRanks(a). sometimes later, generateRanks(b) Result is ...
more »

2017-08-13 13:08 (3) Answers

Multiple instances of javascript variables in html

I am trying to extract the filename of an html page (without the extension) and store it in a variable. The variable name is extracted successfully which I can see in the console. However, even after using getElementsByClassName () (I tried getElemen...
more »

2017-08-13 13:08 (0) Answers

Joining GeoJSON to another GeoJSON

I have some geographic boundaries that I have a GeoJSON endpoint for. I also have some variables that are stored at a separate GeoJSON endpoint which does not have coordinates, but does have the variable that I want to later thematically style a m...
more »

2017-08-13 10:08 (1) Answers

Angular 4: Scroll to top of page programmatically

Does anyone know how to use Angular 4 and programmatically scroll the page to the top? My usescase is that I have a search page, and the input is at the top, and links to the other search results pages are at the bottom. When the user clicks a link...
more »

2017-08-13 02:08 (2) Answers

Consume REST Service using JS

I'm working on an automation project using webdriverio (which runs on node.js) and I'm in need of consuming an REST API to get some data. I have little experience consuming REST API I have done some get in postman. If you guys could point me to some ...
more »

2017-08-13 00:08 (0) Answers

Grouping Numbers JS algorithm

I was trying to solve a problem: Problem: Given an array of Positive repetitive numbers. Output should give an array with odds sorted on the right and evens on the left (no particular order) Input : [4,1,2,3,4] Output: [4,2,3,1] ...
more »

2017-08-13 00:08 (2) Answers

Double alert message

Hello i am trying to learn some validation with jquery and when i make the errors for each field i got 2 messages in alert, here is my project jsfiddle function isEmail(email) { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{...
more »

2017-08-12 21:08 (3) Answers