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
4 views

Can't fix this javascript error

module.js:471 throw err; ^ Error: Cannot find module 'C:\Users\Zlalini\contact\firstapp\Capp.js' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (...
0
votes
0answers
4 views

How to change year in date picker?

I am using UIdate picker from https://jqueryui.com/datepicker/. My code is ok but user who are using this UI date picker can't change current year to next year. In calendar it will display ...
0
votes
0answers
5 views

Div Click Event Not Working - jQuery

I've looked at solutions in several other threads (most with solutions similar to this one: div click event not working) and am just not having any luck getting click events to work on my div. See js ...
0
votes
0answers
5 views

Hi! Im pretty new to this. Im looking for a function that ties together 4 functions to run on user button select. Im out of ideas.

strong text(function ($) { function generate() { var myString = "The quick brown fox jumps over the lazy dog"; var splits = myString.split(" "); console.log(splits); document.write(myString); ...
0
votes
0answers
8 views

Open a link in a different browser tab

How do I open the link in a different browser tab? Here's the snippet I've got: $URL='../uploads/'.$wec; echo "<script type='text/javascript'>document.location.href='{$URL}';&...
0
votes
0answers
8 views

Why window.history.back(); is slowing so much?

I am using it in a function with onclick, and it seems working fine, but really really slow! It takes about 10 seconds after it shows me the previous page! Here is my full code function goBack() ...
-1
votes
0answers
5 views

Javascript For Google Custom Search That Shows First Result URL Only

I need some ideas for how to use Javascript and Google Custom Search to return just the URL of the very first result shown on a search. Using it for some custom code in Zapier. Thanks Shaun
0
votes
2answers
12 views

Browser level caching probelm

I am developing product in language HTML CSS and AngularJS and Api are written in JAVA.Whenever their is update in any functionality i need to clear cache then only changes are reflected,clearing ...
-1
votes
0answers
28 views

why this code not working in javascript [duplicate]

This is my code in java script but its not working after getting input of both value the ans is not giving correct for example when i enter value1 is 2 and value 2 is 3 then it give me ans is 23 but ...
-2
votes
0answers
32 views

adding a button that goes back to home

Firstly this is my website. I made a easy quiz app where users click on the button and at the end the results are shown. Currently I am trying to add a go back to Home button in the results page. If ...
-1
votes
0answers
14 views

Hide form's action page in PHP in the source code

I have two forms on my website that handle payments differently. They both run and work perfectly, but I can easily go into the website, inspect the element and change the action of the forms from "...
-1
votes
2answers
22 views

Random color border-bottom in :after element

The links in my navigation have a border-bottom hover animation that I'm hoping to apply random colours to. This is the entire code so far, but I'm specifically referring to this: #navigation li a:...
0
votes
1answer
11 views

Not allow two or more zero's regex at the start for custom angular directive

I'm writing an angular directive which only allows user to enter numbers in input field within range. html code <input non-negative-number range-min="1" range-max="5000" ng-model="number1"> ...
0
votes
1answer
10 views

cannot use Google Map Search in my Website

I know this question is old and also answered. But it is not working now. I tried Google also but did not get solution of my problem. I want to use only Google Map Search Box which suggest places ...
0
votes
3answers
26 views

Figuring out the javascript snippet behind adding the digits of number

I saw this javascript snippet/ question here The best answer is function sumDigits(number) { var remainder = number % 10; var sum = remainder; if(number >= 10) { var rest = ...
-2
votes
1answer
12 views

how to click li object using java script

I am a mechanical engineer and I am learning JavaScript to automate webpage in IE. Can anybody provide java script for clicking LI objects in HTML page? I tried using below code but it doesn't work....
1
vote
0answers
10 views

Slick Carousel arrows break on Firefox and Safari (.slick-prev, .slick-next)

I’ve modified the Slick arrows within my main style.css file. I’ve added: .slick-prev:before, .slick-next:before { color: gray; font-size: 80px; } This works as desired in Chrome. The ...
1
vote
2answers
23 views

How can I specify the length of an object that is inside a function in JavaScript? [duplicate]

I have been trying to figure out how I can specify the length of an object that is inside a function and inside an array var hotelsList = [] function registerNewHotel(nameParameter, roomsParameter, ...
0
votes
0answers
19 views

assigning a value to function parameter changes the properties of arguments object?

This is probably one of the strangest things that I have seen to do with javascript. Forgive me if there is already an answer, if there is then I am not sure what to look for. I tried this: var ...
0
votes
0answers
14 views

Angular2 directive unit test error with “TypeError: Cannot read property 'indexOf' of null”

when i test a directive in component, i allways get an error. TypeError: Cannot read property 'indexOf' of null, I find that when i create an element in nativeElement, it throws error. and i can't ...
0
votes
0answers
9 views

How to conditionally rename files in-place with gulp?

I have multiple files that I want to rename. I want to do something like this: gulp.task('rename', function () { var scriptFiles = [ 'x.js', 'y.js', 'z.js', ]; var suffix = '-...
0
votes
0answers
4 views

Using basic authentication with SyncFusion ej.DataManager

I'm struggling to setup SyncFusions ej.Grid to use basic authentication when getting or updating data with my API. Has anyone had experience with this? Their examples seem sparse. I've got some ...
-1
votes
1answer
20 views

When I log typeof an IIFE to the console, it is an object instead of a function, why?

I have an IIFE that returns an object. In my app.js file, which I add to a script tag in index.html, I log to the console typeof my IIFE and it is an object. Shouldn't it be a function? Why is typeof ...
1
vote
1answer
21 views

Angular 2: Array.push not working properly

When i push the item into the array, item is pushed but problem is that all items in array becomes same as the last item pushed. pushspecification() { this.specificationSaveDetailList.push(...
0
votes
0answers
24 views

How properly proccess jQuery AJAX in WordPress plugin

I'm trying to add ajax autosave to my settings page in plugin and made this code: <?php function cfgeo_settings_javascript() { ?> <script type="text/javascript" > (function($){ ...
0
votes
1answer
17 views

mocha & chai, how can I mock expect result?

My source code: function getElementCountOfArray(arr) { var countObj = {}; arr.forEach((element) => { if(countObj[element]) { countObj[element] ++; } else { ...
-1
votes
0answers
6 views

how to get lat-long or address using cid on google map

i have link with cid like https://www.google.com/maps?cid=5181875237968641734 now i need to get current location with city and country or current lat and lng of that place using javascript or php. ...
0
votes
4answers
26 views

Javascript on click event not reading else statement or variables

I'm trying to make a click handler that calls a function; and that function gets a string and basically slices the last character and adds it to the front, and each time you click again it should add ...
0
votes
0answers
10 views

jQuery.post() with JSON to Python Flask Results in Nonetype or literally Nothing

I run the following code from within my HTML page with Javascript: $.post(url,{'key':'Value'}) The Python Flask code looks like this: @main.route('/documents', methods=['GET', 'POST']) def ...
0
votes
3answers
32 views

Cannot access data in JSON array nested in JSON object using javascript

I have the following JSON information. It is an array nested inside an object. I am trying to access components of the object, however I cant seem to figure out how to work with the object. For ...
0
votes
0answers
12 views

JavaScript frameworks for hybrid app dev

I want to make a hybrid application in JavaScript. I want to know some of the best and easiest to learn JavaScript frameworks for android development. Ionic needs angularJS which I don't want to learn....
-1
votes
0answers
10 views

grunt-contrib-watch livereload isn't auto refreshing

I re-read the guides on the grunt watch page and followed 3 different examples elsewhere but I cannot get it to auto refresh my page when an html or js file is modified... i mean I am getting the "...
-1
votes
0answers
16 views

how to automatically sign users up for more than one site at once

I am making a web portal where users can go to websites and sign up for free services. I was wondering if there was a way that I could just have the user sign up for our web portal then automatically ...
0
votes
1answer
14 views

Not linking another page by path in AngularJS

I use $location.path() to add there data @object and by submitting a form there is:url.com/@object, but when reloading the page - page is not found: i need not open another page, i just need to reload ...
0
votes
1answer
18 views

Posting array of fields w

I have dynamic fields on a bootstrap three. The form has three parts which are presented in tabs. Form tags are automatically being removed in the modal so I have my fields having out. I can post the ...
0
votes
2answers
46 views

How to replace a img element with a very similar gif element at its exact position at all times

In my code, an element is randomly generated anywhere in the body and when it's clicked, it's replaced with another gif element. I use offset() to get the top and left values of the image first, and ...
0
votes
1answer
5 views

SoundManager2 WaveFormData and PeakData returns 0

i'm trying to setup the SoundManager2 with WaveFormData and PeakData. i have enabled everything as per the docs but SM Object still returns 0 values even while a sound is playing. Any idea why ? ...
1
vote
0answers
28 views

jQuery Methods in Node.js

Just started coding in node.js . I made a few pages (login,signup,blog etc). If I want an effect where : 1. I hover over the "News" button, a slider appears down, To modify image in an ejs tag ( ...
0
votes
0answers
12 views

How to prevent state change in AngularJS 1.6 with ui-router 1.0?

How can we use $transitions to cancel a state change to prompt the user for saving? Previous ui-router versions used to have an event in the callback, and could be stopped with event.preventDefault(), ...
0
votes
0answers
16 views

Post request is succeeding according to database but failing according to Ajax block

I am posting to my database (for context using GAE, and Objectify as a DAO) and it posts correctly (and the backend returns a response of 202), however, under the Ajax it is not calling the "success" ...
0
votes
0answers
13 views

Heroku + Node.js + Peer.js (webrtc): Failed to load resource: net::ERR_CONNECTION_REFUSED

I can't to connect from client script: this.Peer = new Peer({host: PEER_SERVER_ADDR, port: PEER_PORT_ADDR, //at this context: 30028 path: PEER_PATH_ADDR, debug: true, config:{'iceServers'[{urls:'...
0
votes
0answers
9 views

Does Anyone Use Gamesparks Backend Service in Unity For Multiplayer Connection?

Does Anyone Use Gamesparks Backend Service In Unity Game ? I see stackoverflow is lack of thread about Gamesparks Backend Service. Who know someone is already using and could help me with the ...
-3
votes
2answers
42 views

Condition (num % 3 === 0): why does it need to compare to 0?

I have a simple fizzbuzz here: var num = 1; while (num <= 20) { switch(true){ case(num%3 === 0 && num%5 === 0): console.log('fizzbuzz'); break; ...
0
votes
0answers
18 views

Read and modify xml data using javascript

i am having xml file i want to read and modify xml data using javascript,this is my xml data <?xml version="1.0" encoding="utf-8" standalone="yes"?> <figlist> <figgroup name="Circuit ...
0
votes
0answers
19 views

siteTimeout() not working in animation function | Animation not working

I'm trying to build a very simple animation function. I'm using this tutorial to build my project: https://www.youtube.com/watch?v=hUCT4b4wa-8 The result after the button is clicked should be a ...
0
votes
3answers
29 views

What is the time complexity of this bubble sort function? [duplicate]

I wrote this bubble sort function but I am having a hard time figuring out the time complexity of it. function bubbleSort(items) { for (var i = items.length; i > 0; i--) { for (var j = ...
1
vote
1answer
16 views

Sendgrid node js not sending email. Program has no error messages

I am trying to set up an email contact page on my heroku website using sendgrid. I have tried the code with the helper mailer and the one without; however, both do are not able to send an email to my ...
0
votes
1answer
11 views

Assigning Audio Object to Variable Equaling Function [SOLUTION FOUND]

I am creating sound library for my game and I'm trying to make it as clean and flexible as possible. My end goal is to be able to define a variable (as in the below code) and call it in this manner ...
0
votes
0answers
12 views

How to get local time in moment.js on Firefox

Using js library moment.js My local time is now: 05:32 AM After calling moment() I get: Chrome: {..._isUTC: false, _pf: Object, _locale: Locale, _d: Sun Jan 22 2017 05:32:50 GMT+0100 (CET)…} ...
-1
votes
0answers
8 views

Filtering nodes with checkbox in D3

I am a beginner in D3. I wanted to know how nodes can be filtered in D3. For eg. in this example by Mike Bostock, how can one implement a checkbox such that the selected types could be filtered out, ...