All Questions
Tagged with code-snippets javascript
173 questions
1
vote
1
answer
36
views
How to open dropdown from separate button in stackoverflow code snippet
Running code snippet using "Run code snippet" button and clicking "Open menu" button does nothing. It should open menu.
Menu is defined in other place in DOM and display is set to ...
0
votes
1
answer
44
views
Woocommerce wholesale user role setting minimum order quantity to 10 products PHP
I’ve been searching for PHP solutions related to WooCommerce, but nothing I've found has worked for my specific requirements. Here’s the background on my situation:
I need wholesale users to meet a ...
1
vote
1
answer
297
views
Unexpected token error while using javascript snippet with WPCode in wordpress
I am trying to add custom javascript into my website for a widget on wordpress using the wpcode plugin but I keep getting an unexpected token error. There is a already created that isn't accessible ...
0
votes
2
answers
233
views
Is there a way to refresh a webpage using only javascript and browser DevTools?
Problem -Browser Out of Memory
I am in charge of a browser (Edge) tab that runs a Grafana dashboard playlist 24/7 to track stats. After an unpredicted period of time, the tab will show the "Out ...
0
votes
0
answers
151
views
Wordpress open accordion code snippet. Request failed with status code 418 on dreamhost
I am very new to javascript and php.
I am trying to write script in the Code Snippets plugin for a wordpress site to make anchor links to accordions open the accordion.
For example, the URL https://...
0
votes
1
answer
33
views
VSCode Snippet Transform to uppercase inline with regex
I have the following javascript snippet for creating a React Storybook story within a file:
"Create React Storybook Story": {
"prefix": "rss",
"...
1
vote
3
answers
523
views
How can I create VS Code snippets that consume pre-existing text placed before the snippet prefix and use it in the snippet body?
I want to make snippet for console.log(variable) but instead to have prefix I want to make this with "suffix". Here's an example:
var name = "Marco";
var car = "Volvo";
...
0
votes
1
answer
43
views
Transfer variable value from a js file to a chrome snippet and snippet back to js file
Basically I am trying to create a web page that will open boost mobiles web site and pull IMEI's from an MS sql database (no issues with the DB). What I can't figure out is how (or if it is even ...
-1
votes
3
answers
33
views
why can't i type in div and i can't see code snippets when i type getElementById [duplicate]
why can't i change innerHTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"&...
-1
votes
1
answer
306
views
Append elements with the same class to multple divs that also share a class
I'm setting up a store catalog in which I have a div with multiple list items containing 2 divs (one for picture and another one for product summary and add to cart button)
Structure would be ...
1
vote
1
answer
53
views
Javascript Browser Snippet open multiple websites
I want to write a little helper with a Javascript Browser Snippet that opens multiple urls in my local environment. In Chrome, open DevTools => Sources => Snippets and create a new Snippet. Here ...
0
votes
1
answer
31
views
Change date on table from monts-days ago to timestamp
In some internal webpage there is column with "LastBuild" date, but no timestamp there and only something like "X months, Y days ago" or "X days, Y hours ago". There is ...
0
votes
1
answer
154
views
Javascript how to add comma in numbers Wordpress [duplicate]
I have this code working, but the only drawback is I can't get a comma to appear in the thousands. This is because I am not that good with Javascript. Would someone be kind enough to show me how to do ...
0
votes
2
answers
570
views
Adding string to snippets in vs code
I was trying to add a custom snippet but having a problem adding string to the snippet here is the code:
"Default cpp formate": {
"prefix": [
"include",
...
1
vote
0
answers
108
views
Filling and Submitting form with Javascript Snippets in Chromium
I am attempting to fill a form and submit on a web page using JavaScript Snippets. Here is the code:
// sleep time expects milliseconds
function sleep (time) {
return new Promise((resolve) => ...