Quantcast
Channel: Active questions tagged javascript - Stack Overflow

Is this a reliable way to prevent bots from scraping emails?

Is this a reliable way to prevent bots from scraping emails and sending spam, without having to resort to janky methods like images/actual text splitting?<p id="at" data-domain="email.com"...

View Article


How can I use Airbnb style guide with Next.js?

I would like to use the Airbnb style guide with my Next.js 13.4.9 project. When creating a Next.js application, one is asked about enable ESLint. I imagine saying "yes" to this is the recommended way....

View Article


Changing picture on mousemove in JavaScript

I came across this site, and wanted to implement something similar to their picture changing logo whilst the mouse is moving into my own site. I'm not sure if it uses jQuery as the page source is a...

View Article

Organise imports for all files in project

VSCode includes a setting for organising imports, either via the action menu or automatically on every file save. Executing this command removes any unused imports and reorders imports alphabetically...

View Article

Is it impossible to tell if a function is a generator function if .bind() has...

Looks like calling .bind(this) on any generator function breaks my ability to see if the function is a generator. Any ideas on how to fix this?var isGenerator = function(fn) { if(!fn) { return false; }...

View Article


Fullcalendar Vue slot templates

Fullcalendar docs mention only one slot template, "event-content" that can be used to inject Vue via slots. There are also others like day-header-content or day-cell-content, they aren't mentioned...

View Article

How to manage a "generic thread" for heavy operations

I'm working on a new Electron app and I'm struggling with it. I'm using "better-sqlite" which makes sync calls when querying database. For large queries, it blocks my UI because it's running in the...

View Article

Web and physical units

Is there a way to tell/set, how many millimeters an element has, which works across various devices?For example, I would like to create a white window which is 100 x 100 mm, with a black 10 x 10 mm...

View Article


Align an Image Centrally within a Div

I would like to place an image centrally within a div (fiddle). Because I want that div to inherit that div's height from another one that is floating next to it, I had to use this trick.For that...

View Article


mouseOver on touch screen

I want to make mouseOver or hover like command in Javascript. I want when I hold my finger on an element that element changes attribute(get darker) and when you drag your finger on another element it...

View Article

Image may be NSFW.
Clik here to view.

How to get the auto-generated ID?

I'm trying to retrieve the id of the element that I inserted in the database with .key. However, it returns the user value instead of the auto-generated id.How can I get the auto-generated id ?var...

View Article

delete un breakable spaces [duplicate]

I have a software which delivers in an html file a list of words which appear on the screen as:Paris Berlin Rome DublinIf I look at the source code of the html file, I can see:<div id="WordsDiv"...

View Article

require timezone abbrevation using javascript [js] [duplicate]

In JavaScript, callingnew Date().toString()returns something like "Tue Mar 03 2026 15:51:33 GMT+0530 (India Standard Time)" which shows the full time zone nameI want the time zone abbreviation instead....

View Article


How to change color of a row in a table

I'm developing a table in html. Every rows have a checkbox with the same attribute name as tag tr. So I want to color the row selected in yellow if that raw is the unique selected, otherwise color in...

View Article

Image Download Button for Wordpress

How can I add custom image download button for Wordpress?I mean when we click on download button, instantly image downloading starting without any pop up or warning. Please help me with all required...

View Article


Drag dataTransfer data unavailable in ondragover event

I'm trying to get the hang of html5 drag and drop events.function rowDragStart(event) { let targetRowId = event.target.attributes.row.value; event.dataTransfer.setData("text/plain",...

View Article

No paste event when shift key is down in Firefox

In Firefox, I do not get a 'paste' event when the shift key is held down. I do get this event in Chrome. How do I get the 'paste' event when the shift key is held down?See this jsbin exampleThis is...

View Article


Why does `\\"` inside a string still result in `\"` after parsing? [closed]

I’m trying to understand how JavaScript string escaping works at the parser level.Consider this example:const json = '"{\\"name\\": \\"John\\", \\"age\\": 32}"';console.log(json);When I run this, the...

View Article

Any setpixel example?

I'm trying to understand how to use setpixel method that exists in the PaperJS code and its documentation but doesn't work.Here is the Sketch example.

View Article

I want to show some text when I click on an image and hide it if I click on...

I want to show some text when I click on an image and hide it if I click on it again or on any other image, how to do it?Example.

View Article

Align with symmetry

I create an online store. The menu needs to be cleaned up. For this, 3 elements are created .leftside, .rightside, .centerplace and .nestedblock. They are used for marking (rightside must be...

View Article


Image may be NSFW.
Clik here to view.

Offset of the caption relative to the picture

There is a code in which, when you hover over the icon on the left .leftside, a hyperlink in the center .centerplace and an invisible picture on the right .rightside should be hiddenlet sidemenu =...

View Article


revalidateTag() runs after Server Action but auth() still returns stale...

I'm using Next.js 16 App Router with next-auth v5.Inside my React Server Components I read the session using:const session = await auth();I update user data (that exists in the session payload) inside...

View Article

NextJS refresh token cookie not syncing with browser

I've been having this hiccup for quite a while. I'm using NextJS 16 to build a fullstack application with separate NestJS backend. The problem is when I perform a refresh logic, the httpOnly cookies...

View Article

Why can’t JavaScript reliably switch the browser’s built-in spellcheck...

I’m building a multilingual web app where users often switch between English (en-GB) and Portuguese (pt-PT) while typing in the same session.I can enable spellcheck with spellcheck="true", and I can...

View Article


How to pass value to a onclick function in (Jade)pug?

I am new to jade and stuck on this issue. I think I have tried everything from the StackOverflow posts and still at nothing. The things I have tried button(type='button' class=' c-btn-blue c-btn-circle...

View Article

Make Submit button to POST ADS to the homepage web

I'm having issue on my classified ads website. How can I make a post new ads form to render new divContainter at homepageSuch as latest post

View Article

Image may be NSFW.
Clik here to view.

Display the whole image

There is a code. I layout class content. You need to display a picture <img src="../img/mobileimage.png"></img>$(document).ready(function() { all__buttons =...

View Article

Image may be NSFW.
Clik here to view.

Aligning a youtubeicon to the center

There is a page Site view. There is a code (I want to center the image <img class="youtube__icon-play" src="../img/Vector.png">)body { margin: 0; padding: 0;}.globalcontainer { margin-top: 0px;...

View Article



Image may be NSFW.
Clik here to view.

CSS property in jQuery

There are the following pieces of code:$('.catalogbutton').on('click', function(event) { console.log('Before'); $('#dropdownwindow').style.marginRight = "40%"; $('#dropdownwindow').style.display =...

View Article


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>