Questions tagged [javascript]
JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed language used for both client-side and server-side scripting. Its primary use is in rendering and performing manipulation of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).
1,761,327 questions
0
votes
0answers
5 views
Finding table without id using jQuery
I want to select the table with verb conjugations that follows directly on the "Русский"-h1 on the following site:
https://ru.wiktionary.org/wiki/%D0%B8%D0%B3%D1%80%D0%B0%D1%82%D1%8C
I tried many ...
0
votes
0answers
16 views
Reformat strings into a workable data format
I have an array of strings, I am looking for a better way to reformat the following data into a workable format
const list = ["Record - Name: Peter - Salary: 100000 - Position: Accountant - Date: ...
0
votes
0answers
4 views
Adding googleTranslateElementInit to an existing website (not my own site)
I want to translate a page through a google chrome extension and I'm trying to add this function googleTranslateElementInit on another site using right-click mouse "translate this page" on a Chinese ...
0
votes
0answers
6 views
Testing React-Autocomplete in Enzyme
Im trying to test a react autocomplete module using Enzyme and Jest to drive the test. So far I have
test("Render Autocomplete Test",async () => {
let expectedUnmappedEntityArray = [];
...
0
votes
1answer
22 views
Cannot change the src of an img in Javascript (Cannot set property 'src' of null)
I'm new to Javascript so please forgive me if this is a rather stupid question... anyways, I was trying to change the source of an image, but every time the same error message "Cannot set property '...
0
votes
0answers
11 views
Keeping navbar submenus inside the screen
I am using the following script as navbar, however I can't figure out how to make the menus/submenus respect the screen sides, and not continue to open outside of the screen border..
I found a ...
0
votes
0answers
13 views
tabulator - how to extract just the data and save as json object
is there a way to save all data inside a tabulator table into a variable in jquery/javascript?
I noticed that they have a
table.downloadToTab("json");
method which is cool but instead of opening ...
0
votes
0answers
9 views
How do I start a new Ionic 4 app without using Angular?
I am getting started with Ionic 4, and wondering how to start a new app without using Angular? The guide mentions ionic start [name] [template] but this creates a scaffolding set up for Angular. I saw ...
0
votes
0answers
8 views
How to add Input Type=Radio Values using Javascript?
How do I add the values of my input type=radio(s)??
I know I may have some mistakes in my scripts because I've just been copying them from the web. I tried to make figure out what is wrong, but I ...
0
votes
1answer
20 views
Is it possible to have a varying type parameter in a nested structure in TypeScript?
One simple example corresponding to this question "a simple generically typed and type-safe LinkedList like Data Structure" where each next Node can be of different type. For example, the intention is ...
-1
votes
0answers
9 views
How to Change onClick attribute with javascript
how to change onclick value dynamically when i click next button
my html code
<input type="hidden" id="current_question" value="1">
<input type="hidden" id="navi1" value="shownext('1','2');"...
0
votes
0answers
13 views
How to make a listener which fires two scripts when content is updated?
I have a problem when AJAX updates content then I'm losing scripts which are bind to the DOM nodes. AJAX is prefetching these files from other HTML/PHP files. These scripts are Swiper and Isotope ...
-4
votes
0answers
17 views
How to make a top bar like this one?
So I want to add a bar with some social media buttons and email at the top of the homepage but I'm having trouble placing all these things in the same line/bar one after another. How would you do it? ...
-2
votes
0answers
11 views
Copy SVG/HTML content from external file using JS without Ajax?
I would like to use JS to open an SVG file, copy the svg, then paste the svg into the the DOM I'm working with. Is this possible without using Ajax?
I have tried using the svg as an object, but ...
0
votes
1answer
12 views
Start Drag On Click (Angular draggable droppable)
I want to start the dragging when clicked on the draggable element. I am using https://github.com/mattlewis92/angular-draggable-droppable
<div mwlDraggable (click)="startDrag()"></div>
-2
votes
1answer
9 views
How do I align th and td content of a table using Bootstrap 4?
Im having troubles with alignment of th and td content. I dont know what else to do, I´ve used all the possible classes in bootstrap 4 ex: text-center, center-block, align-items-center, justify-...
-3
votes
1answer
29 views
How I can create multiple option in select in Javascript
I can do as individual selection for select list but can't create multiple options.
What is the reason of this & how can I do it?
JS:
$.ajax({
type: "GET",
url: "core/spine.php",
...
0
votes
1answer
15 views
Typescript, function with 2 types of params and returns: Cannot invoke an expression whose type lacks a call signature
I have a function filterAssets which could take 2 different kind of arrays. Below are the 2 different array types:
export interface IResAssetPrice {
currency: string;
price: string;
}
export ...
-1
votes
0answers
22 views
Promise is undefined in webpack bundle file
I have a React/Redux app that uses webpack and babel-polyfill. However, in IE11, I am getting the following error: SCRIPT5009: 'Promise' is undefined.
Before this gets marked as a duplicate question: ...
0
votes
0answers
21 views
pass variable from .php file to external.html file with JS
/inAseperateFile.php
I am creating a dynamic date variable in an external .php file.
i.e.
$date = new DateTime();
echo $date->getTimestamp();
I need to grab it, and print it onto an ...
0
votes
0answers
20 views
when i click a button with Java script function i receive a message that the function isn't defined
function calcRoute() in JavaScript undefined to get direction marker button
when i click on get direction
on button i receive a message that the function is not defined. Thank you in advance.
// ...
0
votes
0answers
8 views
How can I use a Global Mixin method from a Vue instance
Let's suppose that I have the following situation, using a Global Mixin to create a global helper method with Vue:
import Vue from "vue";
Vue.mixin({
methods: {
replaceString: function (...
0
votes
0answers
14 views
heat map hide columns by date
Iv set up a custom onClick event to hide columns in a heat map using a "fake group". Everything works, as long as you wait till the animations finish before clicking on another year form the ...
0
votes
1answer
20 views
Retrieving Nested JSON Array with AJAX and Outputting to an HTML List
The idea is to take a JSON array, loop through each of the entries for planets and output them to an unordered list, with one entry per li. All works well in this instance.
I have successfully ...
0
votes
2answers
19 views
Video.js remove HTML spans
When I prerender video.js player then it add a lot of <span>s in html like:
<span class="vjs-control-text">Video Player is loading.</span>
</div><button class="vjs-...
-4
votes
0answers
21 views
Issue refreshing preview?
While refreshing Chrome during the preview, menu goes purple and finally white again. The issue has been occuring since today, I don't know, why.
I can correct it only if I put a javascript tag in ...
0
votes
0answers
28 views
How to make input validation in react? [on hold]
I have form component
...
import InputGroup from "../../components/InputGroup"
...
class Register extends Component {
render() {
return (
<div className="h-100 d-flex jc-center ai-...
0
votes
2answers
44 views
how to force a hover selector to not occur on a specific div
How do I exclude the first element in a list from being targeted by a :hover selector?
CSS:
.navbar .navbar-nav > li :hover {
color:red !important;
}
HTML:
<li>
@Html.ActionLink("Login"...
0
votes
5answers
46 views
JS - Do sort in an array of strings as dates
I have the following array:
let datas = ["nov/2018", "set/2018", "jan/2019", "dez/2018", "out/2018"]
when I execute
datas.sort()
he orders by alphabetical order, however, I must order first by ...
0
votes
0answers
10 views
When using AngularJS cache in a http get request, even newly added data is not showing in a list / table
I have 2 questions.
Question #1
I have a AngularJS application which manage more than 5000+ rows data tables.
I used AngularJS cache library to manage these data.
$http.get(url, { cache: true})....
0
votes
1answer
22 views
How to format numbers to currency as the user types in Javascript [duplicate]
I am trying to format a users input as a currency. I have an input field where a user would type how much they want to pay. As they type the number I would like it to start formatting as they type. So ...
-1
votes
0answers
35 views
Converting jQuery to vanilla JS - append, prepend, fadeIn
Need to convert some jQuery code into the equivalent vanilla JS code. I thought I had it, but things are messed up. The prepends and appends arent working correctly and the title-share div doesn't ...
0
votes
2answers
38 views
Why is this Vue computed property not reactive?
I'd like my view, using an id passed as a prop, to lookup an object's property in the store. The object in the store appears asynchronously, so the object might not be present right away. I'd like ...
0
votes
0answers
9 views
Three.js - moving the object in the designated area
I am new in THREE.JS.
I'm trying to create something like this:
- floor (planeGeometry)
- OBJ objects placed on the floor
- the user can select a specific object and move it to other places on the ...
-2
votes
2answers
24 views
Stop form submission
I have a script that displays a form with a text input and a button.
Text input is required, but the script only validates the input for empty/not empty.
I need to take it further so it validates ...
1
vote
2answers
13 views
how to get outputStream chunks in sync mode?
is there a way to convert stream to buffer in sync mode?
I need to get it like:
let newBuffer = outputStream.getDataSync();
rather than outputStream.on('data'... like below
let newBuffer = ...
0
votes
0answers
10 views
Tensorflow.js, Transfer Learning to retrain based on a folder of images
I am trying to retrain the MobileNet model using tensorflow.js and ml5.js. I am starting with one item ( drone images ). I have a folder with 88 drone images w. filenames 1-88.jpg all in the folder "...
0
votes
0answers
8 views
error memory A/libc: Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1), thread 22151 (WebViewCoreThre)
i use webview in my application and i want to transfer input type file so when i click on this file within webview i chose image in sdcard so i want to transfer this image to base64 using javascript ...
0
votes
0answers
21 views
regex for dot sequence [on hold]
Need a regex for this case:
a sequence of not dot characters
must fail:
1) .
2) ..
3) ......
must pass:
1) .a
2) 1323a.34aaas
3) aasasd...
0
votes
0answers
16 views
How to inject js of firefox web extension before submitting http request
I am working on a python selenium 3 script to capture HAR with Firefox webdriver. The Firefox version is 65.0.1.
To export HAR from Firefox I use the HARExportTrigger extension.
HARExportTrigger: ...
0
votes
0answers
10 views
Web bottom navigation
I've been following the design of the Material developed by Google and they have a new bottom navigation bar with a shape I would love to know if it's possible to archive on the Web.
Thanks in ...
-1
votes
1answer
43 views
Create Multidimensional Arrays
How about, I entered a series of numbers in a doing the separation by means of a comma (,)
When we press the SEND button, each of those numbers is entered into the BD, with a different ID.
Example:
...
0
votes
0answers
17 views
Mongoose Returns Null when searching by _id that clearly exists
I'm new to MongoDB/Mongoose and have recently started a project using MongoDB, Node and Express and I have run into an issue where when trying to query with mongoose on an _id that exists the result ...
0
votes
0answers
8 views
Is it possible to turn on light on Iphone from browser with Javascript? [on hold]
I found this answer here: Is it possible to control the camera light on a phone via a website?
And it works for android but on Iphone it broke the camera, is it pissible to make it work on Iphone and ...
-1
votes
0answers
28 views
A variable a bit 'strange [on hold]
Ciao, qualcuno saprebbe consigliarmi il modo di recuperare una variabile da form come questa = user[email], è scritta in questo modo perchè comunica con una action su un server , ma con javascript ...
1
vote
5answers
36 views
Check if string includes substring
this question will be explained by an example. I tried to use the includes command for this but this didn't work, you will see why in a second.
I've got 2 variables:
var Tutor = "Physics, English, ...
0
votes
0answers
11 views
Reading a number from Firebase Firestore database and using in a function
I can read a number from the database perfectly fine into a paragraph text in html but I want to use this same number in a function to return a number but when I try to subtract the number in the ...
0
votes
0answers
6 views
Sizing issue with iFrame on mobile (iOS)
I made a custom Shopify cart carousel and it's hosted on my Shopify here and working on its own perfectly. I tried to embed it as an iFrame on my site (see code below) but the width is not working ...
0
votes
1answer
23 views
Override Date constructor
Is there a way to override the Date constructor to check for a valid date before creating a new Date object? For example i have some situations where dates are dynamically created and wrong dates are ...
0
votes
1answer
22 views
Axios: Send variable in the body of a POST request and not params
I am working on a project where i need to send authentication variables in the body of the request and not as parameters. I see that a POST request sends the second parameter as the body in the ...