Questions tagged [javascript]
JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed language used for both client-side and server-side scripting. Its primary use is in rendering and manipulating of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).
1,785,033 questions
0
votes
0answers
4 views
How to remove data from firebase?
I am having trouble removing data from my database on Firebase. I am able to remove data but when I remove the data its removing all my users? I only wanted it to remove the user represented in the ...
0
votes
0answers
9 views
How to make a number with commas as thousands separator in table, javascript
I want to print an integer with a comma as a separator, for example 10,234,234
in the price column.
I have made the function, but I am a little confused how to make it in the table. Below is my code
...
0
votes
0answers
3 views
why submit button getting freezed after submitting the form using jquery-Ajax in Ruby on Rails
when i submit form using jQuery-Ajax in RORthe submit button get freezed.
i am practicing "Integrating Ajax and Rails: A Simple Todo List App", provided by git hub.
http://roseweixel.github.io/blog/...
0
votes
0answers
66 views
How to pass ajax $.get value to another $.get function in jQuery?
I have these function in jQuery :
The problem is I unable to pass the variable branchaddress outside of the function. Can only display inside $.get(); Is there any way I can passed the value or I ...
0
votes
0answers
13 views
Difference between var and let in for loop and link to variable [duplicate]
I have this code:
function print(name) {
console.log(name)
}
var count = 2;
for(var i = 0; i < count; i++) {
var name = "player_" + String(i);
var button = document.createElement("...
0
votes
0answers
42 views
i have a date and time, i want to conver into a relativeTime like twitter. i tried moment.js but it dost not work
I am looking for to convert this date and time to relative time like twitter have ex. 5 sec ago or 1 month ago.
I have stored date and time in different column of database.
i am executing this in ...
0
votes
0answers
41 views
How to segregate JSON and show the largest number
I'm build weather app, and want to show the smallest and largest temperature for 5 days. How to segregate JSON to current days and then take out this numbers?
I tried use array.filter but I'm stuck ...
-1
votes
0answers
8 views
unable to access js variable value into php variable which is acceessed through dependent dropdown list using ajax
Here is the problem in complaints.php file
<script>
function show(){
var res = "success";
return res;
}
</script>
<?php
//echo "<...
0
votes
0answers
22 views
How to update chat room with PHP and Javascipt
I have an issue displaying messages from my database. My site has a simple chat room which was working perfectly when reading/writing to a textfile. I am now trying to link it to a database with a ...
1
vote
0answers
82 views
What is the best way to calculate the font-size of html element while using the rem?
I wanna use the responsive font size by using rem on my website.
As we know, the rem is relative to font-size of the root element. So I should set different font-size of the HTML element in different ...
0
votes
1answer
86 views
How to render React.Component on mouse enter/leave events
Have a problem with rendering react component on onMouseEnter, onMouseLeave events in the list of items
I have a list of items
{data.categories.map((item) => (
<>
<li
key={...
0
votes
0answers
21 views
AppleScript: loop in javascript
How can I loop this code to repeat and set a different variable for every occurrence of the class 'auto-date-time' ?
tell application "Safari"
set myValue to do JavaScript "document....
0
votes
3answers
32 views
How can I take 2 numbers from “form” and add them so I can output the result
I am fairly new at JavaScript and I really can't get this to work fully. I have a form that takes 2 numbers and a button that runs a function which is supposed to add that 2 numbers and display them, ...
0
votes
0answers
7 views
How to display jQuery slidetoggle nav on resize
i have a wonderfully working jQuery slide toggle nav working in mobile view. However when i resize if the nav has been hidden in mobile view it doesnt appear, and it the nav is open when i resize, it ...
0
votes
0answers
27 views
Trying to open a new window to a specific URL, but URL is getting cut off
I am trying to open a window and pass a specific URL to that window. However when the new window is opened, the URL is cut short (does not pass the full URL)
Expected URL to open in new window
https:/...
0
votes
0answers
22 views
How do i encrypt a phrase with a key that gives me a string with good password requirements?
I have the same password for some of my accounts on the internet, and i want to change that, but i can't find a good way to encrypt on the internet which encryptes string acts as a good ans secure ...
-1
votes
0answers
77 views
Does anyone know why all of my elements are being rendered in a single column as if it were a <navbar>?
My component is being rendered in a single column equal to the photo I attached, but it is wrong, it was to be a 5x4 array.
edi1: In an old version of the code I did not have this problem, however ...
0
votes
0answers
7 views
Get the current mouse position in canvas
I am trying to get the current mouse Position in my canvas, currently I have following issue, if my canvas is on the left of the page (0px) the mouse drag function works properly but if I Center the ...
0
votes
0answers
61 views
NuxtJs extractCSS not defer css and slow down the website load
I am trying to improve the performance of my website,
when i added extractCSS:true in nuxt.config.js
I got some css files in the top of page but they are does not defer
I try PageSpeed Insights the ...
0
votes
4answers
72 views
Creating key-value pairs with js reduce() and creating an array as the value
I am having a problem with javascript's reduce() function; I have to put arrays as the value. I can sucessfully create an array but can't add new values to it.
There's an array with words and I have ...
0
votes
1answer
108 views
No function call - onclick doesn't work react
I have two components. The first of them looks like this
class App extends Component {
constructor(props) {
super(props);
this.state = {
change: false
};
this.handleSwitch = ...
0
votes
0answers
19 views
Count the total number of rows of google sheet in script
I wonder if there is a method to count the total number of rows in a Google Sheet.
Note: I don't want to count only the not-empty rows in a specified range, but the entire number of rows (empty and ...
0
votes
2answers
80 views
How to make this JS to show next card instead of random cards?
I'm working on a Swipe card project using HTML, CSS and JS.
I took this JS code from codepen and I implemented it but the problem is the cards are randomizing. How to make it to be in sequence (not ...
1
vote
1answer
54 views
Vue + Vuex using axios asynchrnously yet getters return empty array
My issue is getters that are returning initial state ([]).
in my component I have a created method that sets the axios call result into state.
created() {this.$store.dispatch("SET_STORIES");},
I ...
1
vote
1answer
79 views
How to create json array of object if the key already exist
I'm a beginner with JavaScript and query. I have an html form where the user can add or remove a group of fields. The group of fields contains 1 select and 3 inputs. The group of fields added have the ...
0
votes
0answers
48 views
How can I stop the horizontal repeat of custom tile google map?
I loaded my custom tiles of google map using ImageMapType google map api(v3). I stopped the vertical repeating of map tiles but now I need to stop horizontal repeating of map tile. How can I get that?
1
vote
0answers
16 views
Nodejs pug extend
Absolute beginner here. I just setup new server using node.js but stuck on the pug views. Trying to extends login.pug into index.pug but all i get is blank content except the footer and head. Where ...
0
votes
0answers
12 views
Overlay Scrollbars - Can't get the destroy() method working
I'm using OverlayScrollbars on my website (https://github.com/KingSora/OverlayScrollbars) to display a custom scroll bar in each of my sections.
For design reasons, I want to use this custom scroll ...
1
vote
0answers
55 views
Chart.js creating a line graph with date dots
I'm trying to build line charts with only dots, that represents list of max dates group by other column.
i already build several charts but non of them implements date data.
example of expected ...
1
vote
0answers
25 views
Adding jQuery support in Eclipse EE 2019-03
Several questions similar to this were asked, but many years ago, and the links provided in those questions are dead.
I have installed Eclipse EE,version 2019-03 a week ago (I worked on IntelliJ ...
3
votes
0answers
109 views
I need to animated dot to move in this line and i have no idea how to do this
I need to animated dot to move in this line and i have no idea how to do this. Its need to start in top moving on right along with red line and then go down and move along blue line and repeat.
I try ...
1
vote
0answers
31 views
How to capture output from render function in variable
I'm attempting to generate the svg text wrapped to fit inside a another svg. d3plus contains the textbox module, which has two functions that will do this, but I need to capture the output not render ...
0
votes
0answers
39 views
Load schema json in postman from external file
It is possible to insert a json scheme in the postman test script, where the schema is described in a Javascript file allocated in a defined folder?
0
votes
0answers
13 views
DVWA configuration, Kali linux
I am trying to setup database on DVWA. It shows me an error saying "could not connect to MYSQL Service, please check config file". There is another error aswell saying "Your database user is root, ...
1
vote
0answers
37 views
How can I push multiple values from inputs in a form to an array of objects in mongoose.model?
I am making a list of bibliography entries using a form adding values to a mongoose.model but certain entries would require to have multiple authors.
To add an author I have added a js script ...
-1
votes
0answers
69 views
d3 cannot filter data
I would like to have two datasets by gender using .filter. However, the filter doesn't work and returns an empty array. What could be the reason?
I have a dataset in CSV that looks like this:
...
0
votes
0answers
60 views
How to add custom attributes to each timeslot cell in FullCalendar?
Is there any way to add a new attribute to each timeslot for time grid in Fullcalendar v4?
Something similar to eventRender, where i can set attributes for each event rendered like this
eventRender: ...
0
votes
0answers
62 views
Is there a way to include an array in a where: $or clause with sequelize?
I have a array of Ids teamsIdsSelected = ['1', '5', .., 'X']
Then, from my table named 'Challenge' I want to get all the the challenges that are linked to each teamId from the array teamsIdsSelected. ...
0
votes
4answers
108 views
Passed prop from child to parent not working (React)
I have child component with <form> Value from input. Needs to be passed and rendered in parent component. has onSubmit method which works in child, but doesn't seem to work in parent ...
0
votes
1answer
86 views
Making Ajax output anywhere
I am trying to output the ajax request anywhere within the body but it does not work when i move the target class to some other parent div. How can i target right element so it can show output where ...
0
votes
0answers
22 views
How to get Send And Received bytes info at specific time Using Node.js
i'm a student and creating an application for that i need the data received and send at specific time like the one i have shown in the image
highlighted as purple.
i'm using node.js i haven't found ...
1
vote
1answer
83 views
nestjs/cqrs - TypeError: Cannot read property 'values' of undefined on install
Trying to use the @nestjs/crqrs package, but i get the following error when launching npm install :
(node:77) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'values' of undefined
...
-1
votes
3answers
76 views
Vue equivalent of {{content?.body}} interpolation
In angular we could do something like {{content?.body}} and it will render the content body if it exist in your data.
This doesn't seem to work in Vue. Is there a way to achieve this or i have to ...
0
votes
1answer
62 views
How to offset top bar height dynamically when scrolling down
I am trying to offset an announcement bar when scrolling down, taking into consideration that the height of the bar is more important on smaller devices.
Here's an example of what I want to achieve : ...
-1
votes
0answers
55 views
fetch data by current logged-in user
I want to fetch data from my mysql db using loopback. I want to get, for example, the games that belongs to the current logged in user. how can I do so without saving the userId in local/session/any-...
-3
votes
0answers
146 views
I am trying to project an SVG image contained in an HTML page on a real wall like a 2D hologram
Hello as said in the title , I wanna project an SVG image on the wall to make a 2D hologram, the SVG image is an inside an HTML page, and I am trying to make the background of the transperent, but ...
0
votes
1answer
55 views
Manipulate DOM in chrome extension in a specific div
If I write this in my background.js, it's ok:
$("body").append('<p>hello<p/>');
But if I go to an specific part of the page I cannot write my element:
$('.re-DetailFeatures').first()....
0
votes
0answers
191 views
Javascript: Need some time to execute
Here is my code:
document.onkeydown = function(event){
switch(event.keyCode){
case 32:
//space
alert("Space pressed");
clearInterval(...
0
votes
0answers
14 views
Best pratice for MVC in NodeJS for create all route
I am looking to acquire good practices for a project to achieve with NodeJS.
My question is this: I am trying to create a general road that contains all my roads which would be the best method to ...
1
vote
4answers
93 views
How to search in a json array, and return the result as I type in the input
So far I can only search an element of the array if I type the exact name present in my api, in this my api has an array with 20 positions and if I type exactly the name of the element I search it ...