Questions tagged [javascript]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). This tag is rarely used alone but is most often associated with the tags [node.js], [jquery],[json], and [html].
2,080,530
questions
0
votes
0answers
3 views
Set a delay between For loop
i made this function with jquery and i want to set a delay between every loop i tried to setInterval inside the for loop but it doesn't work .
$(document).ready(function() {
$(window).scroll( ...
0
votes
0answers
7 views
secure an API to accept requests from the same domain
I have an API endpoint that act as a CRUD application for an entity in my application.
I have two options to call this API:
from a frontend page (user performs some actions like clicking on a button) ...
0
votes
0answers
8 views
JavaScript player with a next video button
I just start learning javascript, and I wanted to make a costume player that has a pause/play button, next video button, and previous video button. I have managed to get the pause/play but not the ...
0
votes
0answers
4 views
Can you use JW Player on an Element in a Shadow DOM?
Presupposition
Because of the way HTML elements work in Flutter Web (not relevant to the concept of the question), I necessarily have my div element that I want to use jwplayer on in a shadow DOM.
...
0
votes
0answers
8 views
Avoid loading JavaScript output as a webpage [duplicate]
I am developing an application with a WebView where I can only execute JavaScript code by loading it as URL. So, if I want to remove an element from a page, I can enter the following in the address ...
-1
votes
0answers
10 views
How to make data table with multiple column header and arrow icons in vue.js or vuetify?
Is there any package or documentation in Vue to make a custom table like this?
0
votes
0answers
3 views
How to enable sync manager in electron?
I am building an offline cross-platform using electron. It uses a service worker to make the app offline first. When I try to register the sync manager through following command:-
sw.sync.register('...
0
votes
1answer
17 views
Javascript - Returning a value from a nested function
I'm trying to ReverseGeocode an address from it's lat and long values and display in on a Bootstrap modal, and so I would like to update the variable 'startAddress' with the result from the ...
0
votes
0answers
12 views
How to compare nested array with the map or filter and only return with first match inside?
Following are the code snippet for the data object which contains the information for the codeworks array representing the code and text.
I have one code key array like code = ["ABC","...
0
votes
1answer
10 views
Browser freezes when I execute this simple code to increment number
I am trying to create a div where the number starts from 1 and automatically increments by one - like a stopwatch. But when I run the code, it crashes or does not work.
<html>
<body>
...
0
votes
0answers
18 views
Vuejs mounted behaves differently with aliased `this`
In my Vuejs component I have mounted defined like this and it works without any issue:
mounted: function () {
var self = this;
this.loadStripeScript().then(function () {
self....
0
votes
1answer
12 views
External link in react is being appended with localhost if no http or https present
I'm using this code right now to open an external link from a generated URLs:
External link in react is being appended with localhost if no http or https present
<a href={url} target={'_blank'} ...
1
vote
1answer
26 views
How to use hooks in correct way?
I have some issue
1- I defined a function that gets data from API and calling it in useEffect, It's work well
But i got this warning in VScode.
React Hook React.useEffect has a missing dependency: '...
0
votes
0answers
7 views
Error of filters in primefaces 8.0 on table with row virtualization enabled
I am using Primefaces 8.0.
A table with frozen columns and filters on columns in the frozen part and scrolling part. Row virtualization enabled.
Button code:
<p:commandLink partialSubmit="...
-2
votes
1answer
39 views
Bring code to the front of another in HTML [closed]
i have the following code and it adds a chatbox to the page but the chatbox cant be clicked or typed in it like puts it behind the framed page? How would i go about moving the chat to the front so it ...
0
votes
1answer
7 views
OpenLayers - On click marker zoom at certain zoom level
I want to create on click event on the marker which zooms at a specific level upon click. current code loads marker and upon click zooms to the maximum zoom level of marker. I want to add a specific ...
0
votes
0answers
7 views
jquery multiselect problem with aspx and javascript
I'm using the plugin for multiselect: Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/)
This is my Listbox in aspx head:
<script type="text/javascript">
$(...
0
votes
0answers
5 views
How to get the value of a data-attribute in AlpineJs Component?
I am trying to get the data-countdown value(date&time) from my component into x-data so that I can create a countdown timer out of it.
I when through the documentation and couldn't find anything ...
-2
votes
1answer
14 views
when transferring the html template, the scripts did not connect to the react
Specified scripts and styles in index.html. Styles have been applied but scripts don't work
What could be the problem?
public/index.html
<head>
//my style
<link rel="stylesheet" ...
0
votes
1answer
9 views
How to sort DataTable columns by date
I'm using DataTable in my Django application. Everything works fine, but sorting by date is wrong. It's sorting as string, not date.
html:
<script>
$(document).ready(function () {
...
0
votes
0answers
7 views
How to integrate new features demonstrations inside a JS app? [closed]
I'm looking for good practices concerning the integration of popover (or what so ever) tutorials, after deploying an update for example, to present new features to users (especially for a JS app, in ...
0
votes
0answers
7 views
setting up a custom hooks for react-table
While working with react-table, I came across react-hooks, building custom hooks. I need to move two functions outside into a single file and still be able to exploit the table props like ...
0
votes
1answer
18 views
Adding fade animation to my ready Slideshow
what im trying to do is to make my slideshow do some animation while changing photos, i have the very basic slide show
<div class="slider-wrapper">
<div class="slider-wrapper-...
-1
votes
1answer
14 views
TypeError: res.end is not a function. In passport npm package
this is the error. I am stuck in it. have a look at this..
TypeError: res.end is not a function
at allFailed (C:\Users\sam\OneDrive\desktop\WebDevPractice\secret-files\node_modules\passport\lib\...
-2
votes
1answer
24 views
JS: exit after completion async function
I have promises array and trying to make script exit after its execution:
Code:
Promise.all([promises_array]).then(log.add('ok').create()).catch(log.add('fail').create()).then(process.exit(0));
but ...
0
votes
0answers
10 views
I have two Iframes with different ids and each has button with similar ids i want to reach each button separately in javascript
I'm using Angular 6 and i have an <iframe> element with dynamic id. the <iframe> is loaded twice and the html file of each <iframe> has a button, i want to give that button a text ...
-1
votes
0answers
7 views
Typescript utility function for pixel to inch converter
I need a requirement to convert selected pixels to Inches in angular app. How could do the reusable converter function utility. Better answer appreciated.
Pixel to Inches converter
Pixel to ...
0
votes
3answers
22 views
Revealing items on hover, hide them after X seconds
I'm trying to accomplish a "reveal" effect where I show items from a grid when hovering them.
Everything's OK here but once revealed I want to make them disappear again after X seconds – so ...
0
votes
1answer
9 views
Vanilla Javascript: To-do List Not Creating li Upon Clicking Submit Button and event.preventDefault() Not Working
I am following Dev Ed's beginner to-do list guide using Vanilla Javascript. I couldn't find answers to my question in the YouTube comments, so I'm asking here.
To summarize, I want:
To get a result ...
-1
votes
2answers
27 views
How to always show the vertical scroll bar on div
I want to always show the vertical scroll bar on the div irrespective of the height.
.myclass {
overflow-y: scroll;
}
<div class="myclass">
Lorem Ipsum is simply dummy text of the ...
1
vote
1answer
13 views
How to dynamically bind to :src of img in vue js?
Following is the code for binding to src attribute of img tag.
I'm being able to bind to the attribute. But the link is not getting the real icon from assets folder, instead shows a 404 or not found.
...
0
votes
0answers
5 views
on server restart, 1 message always available for commit in node-rdkafka
I have used node-rdkafka for messages processing, everything working as expected. 1 problem I am facing is everytime, when I restart the server, 1 message always available in the queue, even when it ...
0
votes
1answer
8 views
Can't load a module with custom loader in vue-cli project
I have a project where Webpack 4.43.0 is set up with vue-cli. I'm trying to use
image-size-loader to get image size at build time.
For that, in one of my .vue files I'm trying to load the module using ...
1
vote
0answers
8 views
Dealing with singletons/modules with local state when Server Side Rendering JS
In JS all modules are cached (by Node directly or by Webpack in a browser, for example) so essentially they're all singletons by default.
Some of them sometimes contain a state, like the module in ...
-1
votes
0answers
8 views
I want to create a map file for Gemalto R9 MasterCard cards
I need assistance on how to create a map file for Gemalto R9 Mastercard cards.
I have a sample for Gemalto R6 which I have edited but does not perso card.
I need to know the variance for each card ...
0
votes
1answer
12 views
How to handle http concurrent requests and rate limiting using rxjs
This application needs to make 100 HTTP requests to an external API. The external API is rate limited.
Below is a working solution of handling rate limit using RXJS making use of a map operator to ...
0
votes
0answers
7 views
Best practice : Remove table row with d3.js or css
I have a complex script which handles a few functions , i am trying to make my scripts and browser load time as fast as i can. I am removing row based on business requirement , however i would like to ...
-1
votes
0answers
7 views
Firestore array-contains-any object based on one of two fields
I have following array in my document:
I have SizeFilterComponent which emits BaseFilter object on size select change. I can select multiple sizes.
This is method which handles logic:
selectionChange(...
-1
votes
1answer
20 views
why multi call of decodeURI not works?
here is an example:
// \u7ec6\u8f9b
console.log(decodeURI("%5Cu7ec6%5Cu8f9b"))
// 细辛
console.log(decodeURI("\u7ec6\u8f9b"))
// \u7ec6\u8f9b
console.log(decodeURI(decodeURI("%...
0
votes
0answers
24 views
How to prevent the page from freezing in long loops?
Using a for with big numbers make the browser freeze or even crash. Is there a way to run these loops and not freezing the page?
Using Promisses, async functions maybe? How should i do that?
Exemple:
...
0
votes
0answers
24 views
Submit multiple input values
Im passing the value from Sweetalert Popup to the Form and i get the input sended to me per email.
As i have multiple options to let the user give his input, only the last input get submitted.
...
0
votes
0answers
20 views
how to aggregate true these two values in javascript? [duplicate]
In the code below, I didn't aggregate this two values correctly.
It always prints 7.409964989840811540
How can I aggregate this two values correctly like 47.4099649898408115
var kalmanortalamalar =...
0
votes
1answer
21 views
fetching file from response and viewing it in react
I have a response from backend which looks like :
resumes:[{
id:1,
resume: "/media/resume/a.docx"
},
id:2,
resume:".../b.docx"]
I want to map them and show a table and give a ...
0
votes
0answers
9 views
pg-promise: SQL Names ~ or :name does not seem to work with ParameterizedQuery
I am trying to use a ParameterizedQuery with SQL Names inside its text parameter.
I know that the docs read that this parameter must be a string or a QueryFile.
Basically, what I'd like to do is ...
0
votes
0answers
16 views
Unable to get boolean value from MVC controller function in ajax script
There is a link on page
<a href="#" onclick="ContainsActiveTest('justinb')">Add New Test</a>
there is a controller function which takes a string value as parameter ...
0
votes
1answer
21 views
Update progress bar without refreshing page
I have two php pages. page.php and loader.php. Loader.php pulls data from mysql to fill a progress bar and page.php contains a function to refresh loader.php every second. It works but it's rather ...
1
vote
1answer
14 views
Overflow property doesn't seem to work on navigation links' animation
I have this test page.
As you can see from the demo, I want the menu bar with the links to disappear to the right when the burger icon is not toggled, but overflow: hidden; doesn't seem to work.
Also, ...
0
votes
0answers
8 views
WebWorker loaded correctly but code will not be executed
I hawe this code in that will create a WebWorker to do some update stuff:
main.js
let definitions = {};
const updater = new Worker("js/definitionUpdater.js", { type: "module" });
...
0
votes
1answer
17 views
Desktop compared to Mobile version of the site looks off
I know this might be a newb question to many of you but I'm pretty new at this and seem to have hit a roadblock. The issue that I'm having is that on the desktop, my website looks perfectly fine, ...
0
votes
1answer
28 views
CSS position element before transition and transform
I m trying to translate a div with css transform, and to apply to the movement a transition with css transition.
Is it possible to specify a "start" position to the element? I need to ...