Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged javascript

8 child tags

Use for questions regarding programming in ECMAScript (JavaScript/JS) and its various implementations. This should be accompanied by the specific framework / dialect used (e.g. jquery, node.js, typescript).

This tag doesn't have a detailed wiki yet.

25%
+0 −4
Q&A How to Select From Multiple images to display main product image. [closed]

Below are the links to code for my project. HTML CSS Js Script I have created Magnifying Image which was successful now i am trying to add multiple images which can be display in main produc...

0 answers  ·  posted 2mo ago by abhishek27suvarna‭  ·  closed 2mo ago by ArtOfCode‭

Question javascript html css
75%
+4 −0
Code Reviews How to programmatically click through a list of elements if one has to wait for a click to load a set of predefined new elements?

I would like to download the old-time radio show I Love a Mystery from the OTRR website. I figured out how to construct the list of right URLs, const urlStub = "https://otrr.org/OTRRLibrary/jukebo...

1 answer  ·  posted 5mo ago by toraritte‭  ·  edited 3mo ago by toraritte‭

Question javascript
33%
+0 −2
Q&A Axios error bad request [closed]

I'm trying to use this code with Axios: import "./feed.css"; import Post from "../post/Post"; import Share from "../share/Share"; import { useState, useEffect } from "react"; import axios from...

0 answers  ·  posted 5mo ago by AyeshSoul‭  ·  closed 5mo ago by Alexei‭

Question javascript axios
40%
+0 −1
Q&A Determine which script is slowing the page down in Firefox [closed]

A page is very slow and laggy in Firefox. I am certain it's one of the many Javascripts slowing it down. Out of curiosity, I'd like to figure out which script is creating the heaviest load. Note t...

0 answers  ·  posted 6mo ago by matthewsnyder‭  ·  closed 6mo ago by Alexei‭

75%
+4 −0
Q&A JavaScript redirect is getting "hijacked" and it is not onbeforeunload event.

My redirect in javascript somehow gets "hijacked" and I don't understand how. Previous developer (who is no longer working with the company) on page load initialized onbeforeunload event like so: ...

1 answer  ·  posted 8mo ago by Vanity Slug ❤️‭  ·  last activity 6mo ago by Vanity Slug ❤️‭

Question javascript redirect
80%
+6 −0
Q&A When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once?

When using the Array.prototype.sort method, we can pass a compare function as argument. Then, this function can be used to process array's elements, so the comparison is made using some custom crit...

2 answers  ·  posted 2y ago by hkotsubo‭  ·  last activity 9mo ago by matthewsnyder‭

71%
+3 −0
Q&A Problems with Google Apps Script API JavaScript "How to... Execute function"

As this is the first question about Google Apps Script, here is a very brief description: it is a platform that helps people easily get programmatic access to Google apps data like Gmail messages, ...

1 answer  ·  posted 9mo ago by Wicket‭  ·  last activity 9mo ago by Wicket‭

75%
+4 −0
Code Reviews Vanilla JS Functions Review

I wanted to create a simple static website that would use JS to randomly rotate through a quotes.json file I maintain. My JavaScript experience is more limited as it's not what I do at work, so wha...

1 answer  ·  posted 12mo ago by fausty‭  ·  last activity 11mo ago by fausty‭

Question javascript
75%
+4 −0
Code Reviews CSS grid with expanding cells

Goal Our goal is to create a kind of table, using HTML/CSS/JS, with cells that expand when you click on them. If you click on a header, the whole row or column will expand. This in itself is not ...

0 answers  ·  posted 1y ago by berrie‭  ·  edited 12mo ago by berrie‭

71%
+3 −0
Q&A Adding elements to wrapper after calling wrap doesn't work

I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Mithical‭

60%
+1 −0
Q&A How to use ReactNative SDK with flexible sync using a code first approach

I am working on a React Native app using Realm, Atlas Flexible Sync, and MongoDB, and I'm super confused about how subscriptions work. I'm coming from a .NET SQL background, so I'm completely new t...

0 answers  ·  posted 1y ago by Scriptastrophe‭  ·  last activity 1y ago by Mithical‭

25%
+0 −4
Q&A queryselector for all does not select the specified css selectory [closed]

I tried using query selector but it does not work heres my HTML code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JS + CSS Clock&lt...

0 answers  ·  posted 1y ago by Ansh‭  ·  closed 1y ago by Alexei‭

Question javascript web css
22%
+0 −5
Q&A Replit particles push instead of being background [closed]

I am working on a replit https://AppropriateMessyRoutes.ozabramo.repl.co and I am trying to implement https://github.com/VincentGarreau/particles.js as a background but I keeps on pushing every...

1 answer  ·  posted 1y ago by ObviousPlays‭  ·  closed 1y ago by Alexei‭

Question javascript html css
22%
+0 −5
Q&A How should I deploy my Full Stack Angular Application (MEAN Stack) project on free hosting website? [closed]

How should I deploy my Full Stack Angular Application (MEAN Stack) project on free hosting website? Github I have provided below the github link of the project for the better understanding. Prob...

0 answers  ·  posted 1y ago by mrsilenttradeguy‭  ·  closed 1y ago by Alexei‭

71%
+3 −0
Q&A highlight.js 3rd party plugin error: Cannot read properties of undefined

Highlight.js version: 11.6.0 Node version: v18.12.0 npm version: 8.19.12 When I provide a plugin with the following code to highlightjs (full code is at github): /* Language: BQN Requires: A...

1 answer  ·  posted 1y ago by Razetime‭  ·  last activity 1y ago by Razetime‭

66%
+2 −0
Code Reviews Setting the authentication token in an Angular application for generated API clients

This is a post of mine from Code Review Stack Exchange which did not get an answer yet. I am developing an Angular application that consumes an external REST API. I am using OpenAPI generator (Typ...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 1y ago by Alexei‭

28%
+0 −3
Q&A What is [{options}] in JavaScript?

I am trying to understand this code: const iframes = iFrameResize( [{options}], [css selector] || [iframe] ); The code can be found in this documentation. Is [{options}] an array of objects an...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

25%
+0 −4
Q&A Does a for...of loop must contain a variable without assignment sign, and why?

The following code pattern reflects this answer. This code contains a for...of loop: for (const child of e.childNodes) { // Do stuff; } Does a for...of loop must contain a variable without...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by hkotsubo‭

33%
+1 −4
Q&A How this recursive treewalker works?

Credit for User:Meriton for developing the following code (first published here). function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...

3 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

30%
+1 −5
Q&A Explaining the result of an arithmetic expression in JavaScript

I misunderstand why the following code outputs -1 in console. x = 42; x = (x == 42) * -1 + (x != 42) * x; -1 Due to Type Coercion, the comparison of x to 42 yields true and is thus transl...

2 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

40%
+0 −1
Q&A Is there a JavaScript command to remove all CSS pseudo-elements whatsoever in a document? [closed]

In a dense DOM tree created by a content management system which I didn't create and don't know much about there might be pseudo elements hiding in various places. To ensure that, I want to run so...

0 answers  ·  posted 2y ago by deleted user  ·  closed 2y ago by Alexei‭

28%
+0 −3
Q&A How to make this treewalker code having a regular for loop or a forEach() method?

Credit for User:Meriton for developing the following code (first published here). function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

50%
+1 −1
Q&A Recursion without a procedure ("function") in JavaScript

Credit for User:Meriton for developing the following code (first published here): function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...

3 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

75%
+4 −0
Q&A What are the types of DOM nodes?

If I am not mistaken any DOM "tree" node is actually a "branch", which would be an HTML element or perhaps a CSS pseudo-element, of course. If that's true what are the different node types and esp...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

70%
+5 −1
Q&A Delete all occurrences of a character in a webpage with vanilla JavaScript

Primarily for learning, I would like to try to delete a specific character (letter or number or special character), wherever it is in a webpage, with vanilla JavaScript. The webpage won't change a...

3 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

Question javascript replace
60%
+1 −0
Q&A How to access the visual editor from JavaScript in MediaWiki?

In MediaWiki 1.36.1 with Skin:Timeless, the following JavaScript code doesn't work. I get in browser console: Your skin is incompatible with VisualEditor. See https://www.mediawiki.org/wiki/Exte...

0 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

50%
+0 −0
Q&A MediaWiki JavaScript way to view the history of a page

I wish to view the revision-history-webpage of a webpage in MediaWiki without the conventional button to do so (I've disabled that button for aesthetic reasons). Please disable the MediaWiki View ...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by deleted user

50%
+1 −1
Q&A Why does a keydown event is listened only once?

The following code (credit for user:hkotsubo) moves the user to another page if Alt+Shift+E are pressed together. window.addEventListener('DOMContentLoaded', () => { let domain = window.loca...

0 answers  ·  posted 2y ago by deleted user

75%
+4 −0
Q&A Move to the edit webpage of a webpage via the keyboard with vanilla JavaScript

The webpage example.com has an edit webpage (from which one can edit example.com itself). example.com/index.php?title=עמוד_ראשי&action=edit I want that after I click ALT+Shift+E, I would im...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

50%
+0 −0
Q&A How to uncollapse an entire link tree with JavaScript?

This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

Question javascript html
50%
+0 −0
Q&A In angular-imask how do I get the IMask class?

Using Angular-IMask, I'm programatically updating the field that has IMask. So I'm getting the error: "Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work p...

0 answers  ·  posted 2y ago by nelson777‭  ·  edited 2y ago by nelson777‭

40%
+0 −1
Q&A How to uncollapse the first and second tiers of a link tree in JavaScript?

I wish to display the first and second branches of a link tree with JavaScript. I want to show these branches in a single action, instead of clicking each vertical arrow (link) anew. HTML examp...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

Question javascript treeview
71%
+3 −0
Q&A Why does pushing to one array affect all the arrays in my two-dimensional array?

I was trying to initialize a simple two dimensional array as follows: const arrays = Array(3).fill([]); However, when I tried to push an entry into one of the arrays, it seems like it gets push...

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Moshi‭

Question javascript array
71%
+3 −0
Q&A Detecting if a user has stopped interacting with a web view for a certain time

I am interested in finding out all the aspects I need to cover in order to correctly assess if a user has stopped interacting with a web page. So far, I found the following: Idle Detection API -...

1 answer  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by meriton‭

70%
+5 −1
Q&A A keydown event succeeds for an English letter but not for an Hebrew one, sharing the same key

I am trying to listen to the event in which the keyboard key containing the Hebrew final-letter ך is pressed. This key stands for both the English letter L and the Hebrew final letter ך. If my op...

0 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

50%
+2 −2
Q&A Manipulate a web browser to hide a certain HTML element in a certain website by a single action

Before I publish a new webpage in my website (in the content management system itself), I zoom in from say 100% zooming to 500% zooming and then re-read it, as a nice way to check for typos. The p...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by bta‭

50%
+1 −1
Q&A iframe tag is vertically scrollable although I would expect it to vertically stretch 100%

I have an iframe tag to which I didn't set height so it has a default height which is 150px (at least in Google Chrome). As a consequence, the iframe appears partially in such a way that constant ...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by deleted user

Question javascript css iframe
55%
+3 −2
Q&A Uncaught TypeError: Failed to construct 'FormData' [closed]

I am trying to submit a form with Ajax from a well-configured shared hosting environment. Emails don't arrive to my email client although I have already sent emails without Ajax from this environm...

1 answer  ·  posted 2y ago by deleted user  ·  closed 2y ago by Alexei‭

37%
+1 −3
Q&A How to submit form data with Ajax?

I need to apply backend behavior (PHP directives in my case) to an HTML <form>. The backend behavior I wish to apply to the form is in this pattern (behavior.php): <?php $name = $_POST...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by r~~‭

50%
+1 −1
Q&A How to fire the change event for an input field?

I have added some input to an input field element this way: const inputFiled = document.querySelector("#example"); inputField.value = "X"; I want to fire a change event for that field right af...

2 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

28%
+0 −3
Q&A Why would a form value inserted with value property won't be effective? [closed]

In a website I didn't build, I want to put a value in an HTML input field element with JavaScript and to also use it as-putted. I can put it with the browser console this way: document.querySelec...

1 answer  ·  posted 2y ago by deleted user  ·  closed 2y ago by Alexei‭

71%
+3 −0
Q&A document.open() and the DOM tree of the loaded (closed) browser window on which it works

If I execute in browser console: document.write("Hello"); A new DOM document with the text Hello appears in the same browser window. From MDN documentation: Note: Because document.write() w...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

Question javascript dom
66%
+2 −0
Q&A Understanding createTreeWalker method in the context of replacing strings (or parts of them)

I want to ensure I understand the following code; credit to user:m3g4p0p on Sitepoint, for this code: const walker = document.createTreeWalker( document.body, NodeFilter.SHOW_TEXT ) let...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

66%
+4 −1
Q&A Dye all label asterisks Red with vanilla JavaScript

I want to dye all label asterisks Red with vanilla JavaScript. CSS isn't good for this because it would dye both asterisks and colons (:) instead just the asterisks: .labelWithColonAndAsterisk:af...

2 answers  ·  posted 3y ago by deleted user  ·  edited 2y ago by deleted user

57%
+2 −1
Q&A Change font-family with JavaScript

I want to change the font-family of all elements in a document with JavaScript. I have tried this: document.querySelectorAll("body").forEach( (e)=>{ e.style.fontFamily = "arial"; }); ...

2 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

Question javascript
50%
+3 −3
Q&A How to run a remote JavaScript file from GitHub?

I have a JavaScript file in GitHub which I typically run by copy-pasting all its data into different user script managers (USMs) on different web browsers. I need to start executing that remote fi...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by chovy‭

Question javascript github
36%
+2 −5
Q&A What problem does innerHTML solves?

I understand that innerHTML does all the following actions: It makes the element we work on (or even the entire DOM tree that we work on if that element is <body>) to be copy-pasted into a...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

Question javascript
36%
+2 −5
Q&A What is the main difference between event delegation to other event handling patterns in JavaScript?

I define a software event as any state of a program to which we can probably respond. In JavaScript, how does event delegation differs from more simple and probably more common event handling patt...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

60%
+1 −0
Q&A How can I export metrics from Angular frontend to be read with Prometheus ?

How can I monitor an Angular frontend with Prometheus? I was able to create metrics for my Node.js API using the express-prometheus module. But I can't find any Angular/Prometheus integration. Basi...

0 answers  ·  posted 2y ago by nelson777‭  ·  edited 2y ago by Peter Mortensen‭

57%
+2 −1
Q&A How to append HTML to the DOM with JavaScript?

I have a .html file containing only the following data, and I keep that file on top of my website's directory. <link rel="stylesheet" href="./css/mobile_general_structure.css"></link> ...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by Ullallulloo‭

Question javascript html dom