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
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
Q&A

Posts tagged javascript

6 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.

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 7d ago by mrsilenttradeguy‭  ·  closed 6d 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 27d ago by Razetime‭  ·  last activity 27d ago by Razetime‭

66%
+2 −0
Q&A 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 2y ago by Alexei‭  ·  last activity 5mo 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 7mo ago by deleted user  ·  last activity 7mo 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 7mo ago by deleted user  ·  edited 7mo 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 7mo ago by deleted user  ·  last activity 7mo 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 7mo ago by deleted user  ·  edited 7mo 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 7mo ago by deleted user  ·  closed 7mo 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 7mo ago by deleted user  ·  edited 7mo 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 7mo ago by deleted user  ·  edited 7mo 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 7mo ago by deleted user  ·  last activity 7mo 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 7mo ago by deleted user  ·  last activity 7mo 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 7mo ago by deleted user  ·  edited 7mo ago by deleted user

77%
+5 −0
Q&A TypeScript is unable to infer the correct type for a mapped tuple

I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo&lt;A, B&gt; { (a: A, b: B): any } function test&lt;...

0 answers  ·  posted 7mo ago by Moshi‭  ·  edited 7mo ago by Moshi‭

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 7mo ago by deleted user  ·  last activity 7mo 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', () =&gt; { let domain = window.loca...

0 answers  ·  posted 7mo 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=עמוד_ראשי&amp;action=edit I want that after I click ALT+Shift+E, I would im...

1 answer  ·  posted 7mo ago by deleted user  ·  last activity 7mo 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 8mo ago by deleted user  ·  edited 8mo 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 8mo ago by nelson777‭  ·  edited 8mo 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 8mo ago by deleted user  ·  last activity 8mo ago by hkotsubo‭

Question javascript treeview
60%
+1 −0
Q&A Tackling net::ERR_NAME_NOT_RESOLVED and timeout error on browser object creation when using Puppeteer

Used to work with PhantomJS. Want to upgrade to Puppeteer. Started with some code: "use strict"; const puppeteer = require("puppeteer"); const capture = async () =&gt; { let browser; try {...

0 answers  ·  posted 9mo ago by sbirl‭  ·  edited 8mo ago by Alexei‭

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 9mo ago by Moshi‭  ·  last activity 9mo ago by Moshi‭

Question javascript array
77%
+5 −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...

1 answer  ·  posted 10mo ago by hkotsubo‭  ·  edited 10mo ago by hkotsubo‭

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 10mo ago by Alexei‭  ·  last activity 10mo 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 11mo ago by deleted user  ·  edited 10mo 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 11mo ago by deleted user  ·  last activity 11mo ago by bta‭

77%
+5 −0
Q&A How to deeply clone an array in Angular / TypeScript?

I have an array that I need to clone in Angular / Typescript. That is, any change done on an element from the cloned array should not affect the content of the initial array. How can I achieve thi...

2 answers  ·  posted 11mo ago by Alexei‭  ·  last activity 11mo ago by hkotsubo‭

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 12mo ago by deleted user  ·  last activity 12mo 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 12mo ago by deleted user  ·  closed 12mo 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 &lt;form&gt;. The backend behavior I wish to apply to the form is in this pattern (behavior.php): &lt;?php $name = $_POST...

1 answer  ·  posted 12mo ago by deleted user  ·  last activity 12mo ago by r~~‭

71%
+3 −0
Q&A Hash sign as a path component in a user script's @match command prevents the script from running

I try to exactly match a login page in a website, for a user script manager (USM) script, which I run with Tampermonkey. This pattern didn't work: // @match https://example.com/#/login ...

1 answer  ·  posted 12mo ago by deleted user  ·  edited 12mo ago by Alexei‭

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 12mo ago by deleted user  ·  edited 12mo 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 12mo ago by deleted user  ·  closed 12mo 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 1y ago by deleted user  ·  edited 1y 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 1y ago by deleted user  ·  last activity 1y 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 1y ago by deleted user  ·  edited 1y 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)=&gt;{ e.style.fontFamily = "arial"; }); ...

2 answers  ·  posted 1y ago by deleted user  ·  edited 1y 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 1y ago by deleted user  ·  last activity 1y 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 &lt;body&gt;) to be copy-pasted into a...

1 answer  ·  posted 1y ago by deleted user  ·  edited 1y 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 1y ago by deleted user  ·  edited 1y 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 1y ago by nelson777‭  ·  edited 1y 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. &lt;link rel="stylesheet" href="./css/mobile_general_structure.css"&gt;&lt;/link&gt; ...

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

Question javascript html dom
71%
+3 −0
Q&A How to make the text box such that its placeholder goes up and arranges itself in the centre of the border upon clicking?

How to make the placeholder so that it goes to the top of the border line on click? For example, when you go to Gmail and click on the input field, the placeholder text goes up and arranges itself...

1 answer  ·  posted 1y ago by nobodyImportant‭  ·  edited 1y ago by hkotsubo‭

Question javascript html css
60%
+1 −0
Q&A Using http.get to get page from frontend

It's possible to use Angular 8 http.get to get a page from the frontend itself ? My local frontend url: https://192.168.0.177:4200/ I tried in a service: test(): Observable&lt;string&gt; { ret...

1 answer  ·  posted 1y ago by nelson777‭  ·  last activity 1y ago by Derek Elkins‭

71%
+3 −0
Q&A setting of translateX for carousel image slider

I made carousel image slider by following tutorials. To slide images , I made the below function. const moveToSlide = (track, currentSlide, targetSlide) =&gt; { track.style.transform = 'translat...

0 answers  ·  posted 1y ago by aya2222‭  ·  edited 1y ago by aya2222‭

42%
+1 −2
Q&A How do I filter an array in C?

No, I'm not trying to get the full program written completely in C by you guys. I only need some way to implement the functionalities of each function I found confusing. In this challenge in Code ...

2 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by Derek Elkins‭

Question c javascript array
57%
+2 −1
Q&A Function.prototype.call()

I wanted to print to browser console the number of li list items of a given ul list. This didn't work (console output was undefined): console.log(document.querySelectorAll(".example").length); ...

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

57%
+2 −1
Q&A How to include HTML files in another HTML file with vanilla Javascript?

I develop an HTML-CSS-JavaScript-PHP contact form and I have a large HTML file which is very long and very wide (lots of horizontal scrolling due to nesting) and it's hard for me personally to work...

0 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

60%
+1 −0
Q&A Uncaught ReferenceError: variable is not defined

I have a variable defined using const keyword. function Text() { const variable = "Hello!"; } console.log(variable); When I try to access this variable, I get: Uncaught ReferenceError...

1 answer  ·  posted 1y ago by Kevin M. Mansour‭  ·  edited 1y ago by Alexei‭

37%
+1 −3
Q&A theme always not changing [closed]

const body = document.body; const light = evt =&gt; { body.setAttribute('data-theme', 'light'); localStorage.setItem("theme", "light"); console.log("light"); } const dark = ...

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

Question javascript html theme

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate