Questions tagged [javascript]

For questions about programming in ECMAScript (JavaScript/JS) and its different dialects/implementations (except for ActionScript). Note that JavaScript is NOT Java. Include all tags that are relevant to your question: e.g., [node.js], [jQuery], [JSON], [ReactJS], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

748,205 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
53 votes
2 answers
3k views

WKWebView loads HTML content too slowly in iOS 9 using swift

I have been trying to integrate the WKWebView as a subview of another webview in a UIViewController. I've been able to load the content and communicate properly with the swift and JavaScript. However, ...
Krish Lakshmanan's user avatar
50 votes
0 answers
476 views

swf respondDecisionTaskCompleted call, response time degrade overtime

We have a decided worker running and as the time goes we noticed the response time of the respondDecisionTaskCompleted call was getting slower and slower. We tried using the same instance of SWF ...
Eatdoku's user avatar
  • 6,599
47 votes
0 answers
4k views

Incorrect line numbers - sourcemaps, Webpack 2 Typescript

This issue occurs in Chrome 59.0.3071.115 and Firefox 54.0.1 I have been doing a lot of research on trying to get correct line numbers for my Typescript source code using Webpack 2.2.1 and the open-...
Brian Ogden's user avatar
  • 18.5k
47 votes
1 answer
22k views

HTML5 Drag and Drop effectAllowed and dropEffect

The relationship between these two properties seems to have been the source of some confusion. Based on reading both the MDN site and MSDN I thought i had figured it out, but now I am not sure... I ...
Woody's user avatar
  • 7,628
40 votes
0 answers
5k views

Recaptcha V3 error incorrect-captcha-sol randomly

I'm getting incorrect-captcha-sol error code sometime while using Google reCAPTCHA server side verification api. I have integrated google recaptcha validation to some of my apis. To do so, I pass ...
Rahul Bansal's user avatar
37 votes
2 answers
7k views

How can I get the stack trace for a JavaScript exception in IE 8?

When a JavaScript exception is thrown in IE 8, how can I see its stack trace? For example, the following code from jQuery catches an exception and rethrows it. Debugging in Visual Studio (2012), ...
aknuds1's user avatar
  • 65.8k
36 votes
2 answers
465 views

Cross Origin in ajax not working for .properties file in IOS (10.3.1)

I used i18n plugin for load *.properties file for translation and its working fine on android platform but same library not working on IOS 10.3.1. It gives me below error: i have done some changes in ...
user avatar
36 votes
3 answers
5k views

React Dev Tools: "parse hook names" action throws a "Hook parsing failed" error

When I inspect my code using the react dev tools, I'm noticing some hooks trigger this error and cause the "parse hook names" action to error out. When I inspect the react dev tools, it ...
sgarcia.dev's user avatar
  • 5,731
35 votes
3 answers
1k views

Uploading File in parts using XMLHttpRequest and auth digest

I am trying to upload a local mp4/movie file with XMLHttpRequest() on a server. This is written with react-native and in a final version user would be able to upload any big files from his/her IOS/...
Dirindon's user avatar
  • 634
34 votes
1 answer
2k views

Dropzone.js no longer uploading multiple imgs to website on Android

Up until about a couple weeks ago, my web app was working great on desktop and mobile, using dropzone.js as a drag and drop means of uploading images. Now suddenly on my Android device things have ...
tllewellyn's user avatar
33 votes
3 answers
13k views

Looking for a Dual Listbox with AngularJS and Bootstrap

I am looking for a component like this to be included in my project: http://geodan.github.io/duallistbox/sample-100.html I want to install it with npm. The problem is that I tested some of the ...
Iker Aguayo's user avatar
  • 3,990
32 votes
1 answer
1k views

Having trouble working with SelectWoo instances of Select2 within WooCommerce

I am using Select2 within WooCommerce in some of my own custom areas and I am targeting it with some code to add and removes certain classes and it's working fine except for the SelectWoo instances ...
Brett's user avatar
  • 19.5k
28 votes
2 answers
624 views

How to minify and factor-bundle files in the same browserify command?

I currently have this factor-bundle command which I use to bundle my files, and pull everything common into a common file: browserify index.js bar-charts.js list-filter.js dashboard.js -p [ factor-...
Richard's user avatar
  • 63.1k
28 votes
2 answers
1k views

Get Download Url after firebase's resize extension completed

This is what I am trying to achieve, implement the firebase's resize image extension, upload an image, then when the resize is completed, add that dowloadUrl's thumbs to a Cloud Firestore document. ...
Haniel Baez's user avatar
  • 1,644
27 votes
2 answers
4k views

Unable to import webpack-bundled UMD library as an ES6 import

I've authored a javascript library using Webpack. The entrypoint someClass.js looks like this: import x from './x' /* several more imports here */ class SomeClass {} export default SomeClass; My ...
StillFiles2's user avatar
27 votes
3 answers
2k views

JavaScript FileReader Slice Performance

I am trying to access the first few lines of text files using the FileApi in JavaScript. In order to do so, I slice an arbitrary number of bytes from the beginning of the file and hand the blob over ...
kacase's user avatar
  • 2,013
26 votes
3 answers
15k views

"This Suspense boundary received an update before it finished hydrating." Error when using suspense and dynamic import in Nextjs

I'm trying to lazy load a list of data with suspense and dynamic import in Nextjs. But getting following error: Error: This Suspense boundary received an update before it finished hydrating. This ...
Hashem Mashem's user avatar
26 votes
1 answer
5k views

How to detect if Prevent Cross-site tracking is active on Safari 13 with javascript

I would like to detect when Prevent Cross-site tracking is active in a browser using JavaScript. My challenge is trying to find a method to detect this and show a warning popup to the user when this ...
Berk Özel's user avatar
26 votes
2 answers
833 views

Mobile Safari crashes when using Hammer.js

I am working on a multi-player game in Javascript for the iPad. I am using Smartfox Server for the multiplayer, and Hammer.js for touch events. I am having an issue where when I use a Hammer ...
user3203339's user avatar
25 votes
1 answer
6k views

React/Next.js site doesn't load properly in Safari (blank page)

I know this is very general but I have a bug in my Next.js website, where when I open my site in Safari, it sometimes loads and sometimes doesn't (almost 50/50 chance - shows a blank page, but I can ...
TommyVee's user avatar
  • 849
24 votes
4 answers
3k views

VSCode auto imports for React Native with JavaScript

I know VSCode supports auto import for JavaScript. For some reason, it does not work with React Native. There is even a dedicated section on the VSCode website for this. But it only answers how to ...
J. Hesters's user avatar
  • 13.2k
24 votes
2 answers
3k views

Which Chrome keyboard shortcuts cannot be overridden with Javascript?

You can preventDefault() on Chrome shortcuts with JavaScript, but you can't do it with all of them. Ctrl + S and Ctrl + F you can override. Ctrl + W you cannot. This makes sense. Ctrl + L though I was ...
Slbox's user avatar
  • 11.1k
23 votes
1 answer
4k views

Trigger IntersectionObserver when element is already in viewport

The IntersectionObserver is triggered when an element is visible in the viewport for a certain amount (0-100%). This means, when the element is already 100% in the viewport it does not trigger anymore,...
s1gr1d's user avatar
  • 385
23 votes
2 answers
2k views

JavaScript eval() fails with window.external.notify(), works with window.alert()

On WP8, if I execute (1): Microsoft.Phone.WebBrowser wb; wb.InvokeScript("eval", "window.external.notify('abc');"); It throws a 'target of invocation returned an error', unknown error, hresult ...
BobHy's user avatar
  • 1,575
22 votes
1 answer
3k views

Rails Activestorage + DirectUpload javascript progress bar not showing when using "remote:true"

I have been using Rails ActiveStorage DirectUpload in my Rails app. And here is the code of the form: <h3>Select Files To Upload</h3> <%= form_for @uploader, url: uploaders_file_path(@...
Ryzal Yusoff's user avatar
22 votes
1 answer
475 views

Updating AngularJS scope after validating search form in Symfony2

Hi fellow developers, We have to rewrite a software application in Symfony2 with AngularJS, we use Symfony2 for the MVC purpose and AngularJS for the useful functions. Here's our problem, we first ...
Dylan Gauthier's user avatar
22 votes
2 answers
7k views

How to fix the console warning "The resource ... was preloaded using link preload but not used within a few seconds from the window's load event"?

I'm developing a gatsby theme/starter for PWA's, but I can't seem to get rid of the following console warning: The resource https://davidde.github.io/gatsby-starter-simpwa/page-data/offline-plugin-...
David Deprost's user avatar
21 votes
0 answers
2k views

Using Apollo's writeFragment to update nested list

I am working on a application in which a ship can be configured using rudders and other stuff. The database structure is sort of nested, and so far I have been keeping my GraphQL queries in ...
ErikRtvl's user avatar
  • 326
21 votes
1 answer
2k views

Jest onFailure hook

I have a test suite running using Jest. I would like to trigger a hook after any failed test, ideally with the context of the test still available. Specifically, I am using Puppeteer via jest-...
Pavel S.'s user avatar
  • 11.9k
21 votes
1 answer
2k views

How to add Spine animation to Phaser game?

I am new to Phaser and the whole javascript games, and I am trying to add Spine animation to Phaser. Is there a way to do that? I also tried to play my animation using Pixi.js and it worked. Also I ...
Mohamed Termoul's user avatar
21 votes
2 answers
5k views

Debugging Web Workers in Safari Web Inspector

Chrome's Dev Tools are great for debugging web workers as I can "browse" into that JavaScript environment and set break points. Even the console works as expected. On Safari, it is a completely ...
Daniel A. White's user avatar
20 votes
3 answers
5k views

How to get rollup to include a dependency from another package in a lerna monorepo in its transpilation (TypeScript)?

I created a minimal example to show the question I have: Github repo. I have a lerna monorepo with two npm packages in the packages folder, the packages are called: utils: exports a function: ...
evianpring's user avatar
  • 3,328
20 votes
2 answers
5k views

Merging/mixing two audio streams with WebAudio

I have a MediaStreamSource sourced from navigator.getUserMedia, which is connected to a GainNode, which in turn is connected to a ScriptProcessorNode, like so: [getUserMediaStream] -> [...
eirikrye's user avatar
  • 281
20 votes
2 answers
6k views

How to determine when a browser has finished painting an inserted element?

I have a web page that is injecting HTML delivered via AJAX. I don't know, a priori, the size of the content, but I need to position the content on the page based on its size. Here's a simple approach ...
Stephen Thomas's user avatar
19 votes
0 answers
14k views

Error: <g> attribute transform: Trailing garbage, "translate(0,NaN)" on dc.js brushing

The purpose of my code is to use the range chart(bar chart) that shows the count of the datasets produced in years, to brush on the focus chart(line chart). The focus chart then displays the count on ...
user3050590's user avatar
  • 1,666
18 votes
3 answers
4k views

TypeScript issue with styled-component's "css" prop and Storybook

I'm having issues with enabling styled-component's css prop in TypeScript as soon as I import something from Storybook, because Storybook depends on @emotion/core, whose type declaration defines ...
silvenon's user avatar
  • 2,068
18 votes
1 answer
1k views

React native (expo) web view Error net::ERR_CACHE_MISS

I am using react native(expo) and try to use web view package And i am getting this warning in console and didn't see anything on mobile screen. "sdkVersion": "36.0.0", "expo": "~36.0.0", ...
user avatar
18 votes
3 answers
4k views

getUserMedia constraints ignored on Safari 12

For some reason Safari 12 (haven't tried on other versions) is completely ignoring getUserMedia constraints. My code looks something like this navigator.mediaDevices.getUserMedia({ video: { ...
Kkulikovskis's user avatar
  • 2,028
18 votes
2 answers
7k views

Add selected items to ng-select with multiple and typeahead

I'm using ng-select to select multiple values from a large list that is remotely loaded depending on what the user types in the box. Here are my requirements: Tags added dynamically Dropdown is not ...
eltiare's user avatar
  • 1,817
18 votes
1 answer
3k views

Client Lifecycle events in ASP.NET Core SignalR

I'm currently upgrading a project from ASP.NET SignalR 2.2.3 (OWIN) to ASP.NET Core SignalR 1.0.2 (Kestrel). SignalR 2.2.3 supported several client sided lifetime events like reconnecting, ...
Robar's user avatar
  • 1,929
18 votes
2 answers
592 views

How to start a new connection with CosmoDB graph database using gremlin on version ^3

I am trying to create a new gremlin client in node js, but I cannot find any documentation how to set up the connection with both a URL and a primary key (as generated in Azure CosmosDB). Examples ...
Michal Paszkiewicz's user avatar
18 votes
1 answer
18k views

Instagram Sharer Url

I need to build a share link for instagram. for example, these are the sharer url for others socials: export const SOCIALS = { twitter: "http://twitter.com/intent/tweet/?url=", facebook: ...
Hitmands's user avatar
  • 13.5k
18 votes
1 answer
2k views

Update only the chunks that have changed with Webpack.watch()?

I have a webpack build that utilizes the watch() method to continuously rebuild my javascript as I work. I also have a watcher that uploads changed JS files to a remote server. Right now when I ...
lostPixels's user avatar
  • 1,313
18 votes
1 answer
2k views

Why does Chrome convert the image data to "image/png" mime-type when an image is pasted?

After copying and pasting a JPG image file into Chrome, analysing the data from the Event.originalEvent.clipboardData, the image type is image/png. Why? OS : windows 7 I think it's not possible that ...
Ziyu Zhou's user avatar
  • 1,679
18 votes
1 answer
893 views

PhantomJS skip header on first page

I want to remove header from first page and I have header defined as: header = { height: header_height, contents: phantom.callback(function(pageNum, numPages) { if(pageNum == 1) { ...
sneawo's user avatar
  • 3,543
18 votes
1 answer
6k views

Is it possible to capture "Open in New Tab" clicked event of context menu using javascript?

I know I can use capture the Right Click event by using jQuery's "contextmenu" but my question is, how can I capture the event after the context menu appears i.e. When the user clicks on "Open Link in ...
pso's user avatar
  • 819
18 votes
5 answers
16k views

org.apache.commons.codec.DecoderException: Odd number of characters

Sending hex string in url parameter and trying to convert it in to string at server side. Converting user input string by using following javascript encoding code function encode(string) { var ...
Rahul P's user avatar
  • 1,065
17 votes
2 answers
3k views

Slow Vite startup

Recently I started a new project in React v18 which uses Vite v4.1.1 as a build tool. After installing a few libraries the initial load of the app (after running npm run dev) takes several minutes ...
Stanislaw Gardzielewski's user avatar
17 votes
1 answer
1k views

Nashorn in Java 11 behaves differently from Java 8 when evaluating named functions

I have a Java application that allows users to manipulate certain objects at runtime by defining a JavaScript function. We are currently doing this with Nashorn in Java 8, but we are looking to move ...
Joel Westberg's user avatar
17 votes
2 answers
465 views

sheetJS: How should the cell object look when you want to transform milliseconds to h:mm?

Does someone have an idea how the cell object should look like when you want to transform a value in milliseconds to a duration format of h:mm? At the moment I have a cell object which looks like { t:...
Logan_Dupont's user avatar

1
2 3 4 5
14965