返回首页

Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed, and interpreted language used for both client-side and server-side scripting. Its primary use is in the rendering and manipulation of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Animation using Javascript

could any kind soul help me in my program as I am new to HTML, Javascript, and CSS? In my CSS, I have 4 different animations going to different locations. So for example if, I want to do a case ...
0
votes
0answers
4 views

How to get all tabs details from current browser in chrome extension?

I have opened multiple browser windows in google chrome. I want to find all the tab details in the current window browser. ie., no tab details from another browser. So in my chrome extension, I am ...
0
votes
0answers
3 views

How can I style a component whose class changes based on a `use` directive in Svelte?

I am creating a directive which adjusts the class of the element that it is applied to. However, the styles for that class do not apply when the class changes. For instance: Form.svelte <form id='...
0
votes
0answers
7 views

Slick Dot active and slick slider dont Match when click Slick button

The concept of this slider is to make the slider centered and also the custom slick dot. I try to apply clone for the customise slick dots, so I can make it center same as the centermode of the ...
0
votes
0answers
4 views

how to call ajax to display php page content on tab click

I have multiple tabs. Under meals Default is breakfast then lunch and so on. And under transfers i have different tab. (See image) currently i included php page for each tab but i want call php page ...
0
votes
0answers
6 views

Need help muting multiple audio files

I'm helping a student with their work, and we have a mute button working using IDs, but of course that only mutes one thing at a time. We want to be able to shut off ALL audio playing at once. If I ...
0
votes
1answer
10 views

How to set sate only after fetch is completed with all ids inside the object

I'm trying to set the state after a fetch operation loop is completed(To display a loader until data is fetch is completed). I'm using an async function to do this bu the data.map is still running and ...
0
votes
1answer
16 views

HTML/CSS/JS not displaying slideshows pictures

I bascially just copied the slideshow tutorials from W3schools, i see the pictures when i inspect the page but the actualy images are not displaying on the website. I can't figure out if I missed a ...
0
votes
0answers
11 views

How to display image thumbnail using angular image upload

I am using ng2-file-upload to upload the image. please check below link image upload All are working well. But my requirement is ,when i brows image, it should show as a thumbnail (image preview). ...
1
vote
1answer
22 views

Hide/Show a checkbox based on json value

I have 4 check boxes and I want to hide/show them based on the value that I am getting in my JSON. I'll get only one name of checkbox in my JSON and only that particular checkbox will be shown to user ...
1
vote
1answer
16 views

create json array in javascript [duplicate]

I have a json object like this { "description": "THURSDAY ", "count": "1", "date": "2019-12-05" }, { "description": "WEDNESDAY", "count": "0", "date": "2019-12-04" } ...
0
votes
0answers
6 views

how to add class name to svg dynamically? [duplicate]

I have created svg element: var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.className = "lbi-svg"; I have added to classname "lbi-svg", this class name is not ...
0
votes
0answers
9 views

Angular 7, why scrolling is blocked on the page when using mat-checkbox

I have not been able to solve this problem for several days, no one could help me. I have a scrolling issue, I am using angular / material in my project and I have a mat-checkbox element. When the mat-...
0
votes
1answer
17 views

Store the value returned by the prompt function inside a variable called currentPlayer

How I can store the value returned by the prompt function inside a variable called currentPlayer I've done this so far but I could not understand what to do next function prompt (X = 1, O = 2) { ...
0
votes
0answers
8 views

How to Render ReactJS Build Folder based on Device Type in Netlify

I have 2 build folders in my Netlify hosting. How to condition which build folder to render depending on user's device type? -Build-Desktop which contains ui library Ant Design Desktop -Build-Mobile ...
0
votes
1answer
12 views

How do I complete an app.post that grabs the LAST_INSERT_ID and runs a second app.post using that last inserted id?

This is what my code looks like: var first_name; var last_name; var email; var id; var obj; //User register post app.post('/user-register', registerCheck, (req, res, next) => { first_name = ...
0
votes
0answers
13 views

Starting a jQuery timer after an event rather than page load

I am running a jquery timer from following page: http://hilios.github.io/jQuery.countdown/documentation.html#controls The code is as follows: //Timer var hms = '00:45:00'; // Time Input var a = ...
0
votes
0answers
10 views

How to mock a method inside a method using JEST?

I am trying to unit test a method called search which has three methods such as buildSearchParameter, isUnknownFields, readAll. I need to mock them but i have no idea how to do it as i am new to Jest....
0
votes
2answers
41 views

jQuery - check if target is specific div

$(".closebox").click(function(){ $('#uploadbox').hide(); $('#lightbox').hide(); $('#deniedbox').hide(); $('#confirm_delete_box').hide(); }).children().click(function(e) { if($(e....
0
votes
0answers
7 views

Why do we want to use implicitlyWait in protractor test case?

browser.manage().timeouts().implicitlyWait(2000); Does the above line makes the protractor test cases slow?
1
vote
1answer
17 views

How to Remove $id from list in Angular JS?

Here is my List { $id: "1" cashOnDeliveryCharges: "" deliveryMethod: "" order_date: "06-12-2019" order_no: "ORD000105" paymentMethod: "Shopping Wallet" registered_email: "Sambasivarao@smartsoft.in" ...
0
votes
3answers
27 views

Async nature of setState() not showing updated props from parent component

I understand that setState() is async by design in react, and I get why - because JS is single-threaded and so are browsers, therefore re-rendering is an expensive operation. I have a very (what seems ...
-1
votes
0answers
23 views

How to load more or show less div/cards on button click without using jquery

I have a working code for this requirement in jquery which displays the specified number of cards/divs and loads more or loads less rows when I click on show more and show less buttons. I need to use ...
0
votes
0answers
21 views

Updating location state in the route is not reflecting on the parent components

I have a react app and I am using react-router for routing. I have created a <PrivateRoute> component which renders the component only when the user is logged in. In the app, the title in the ...
0
votes
0answers
15 views

Dynamic Page PDF generation using angular5

I am using html2canvas function for generating PDF file.Here I have one static page content, next page content is dynamic one am fetching from database in table format that will come more than one ...
0
votes
7answers
45 views

Map one property from object array to another object in different object array

I have two object array. let's say Shop array & Country array. An Shop array's one object has {id:01,name:'name of the shop',countryCode:'USA'} and Country array's one object has {code:'USA', ...
1
vote
2answers
32 views

Play video on mouseOver using JS in React

Just trying to get these videos to play on mouse over. I can see from the console I need to make a function instead of using a string (other SO answers use strings), so how can I do this without ...
-4
votes
1answer
27 views

why javascript template string can not compiled string return by another function [closed]

template string not works when i tried like this function a () { let hello = '123' let str = `${hello}${b()}` console.log(str) } function b () { let str = `\${hello}` return str ...
0
votes
0answers
16 views

Can I decrypt an encrypted pdf file done by php in javascript?

I have encrypted a pdf file using following code <?php // Key for encryption and decryption $key = '1323214214124325bw4tertbretbertertetrt'; function my_encrypt($data, $key) { // Remove the ...
0
votes
0answers
14 views

Custom function in Google Script doesn't work when downloaded as Microsoft Excel

I am very new to JS. I wrote a simple function in Google Script. It worked well in Google Sheets. But, give an error when the sheet is downloaded as Microsoft Excel. My function if as below. function ...
0
votes
0answers
34 views

Loop through JSONobject, JSON.parse gives undefined

My java code is as below. toJSON converts List to GSON. //.... String responseText = myUtil.toJSON(fileList); response.getWriter().write(responseText); public String toJSON(List<...
-5
votes
1answer
28 views

Why would JS allow this function to be declared?

I have a question about decalaration of JS function. I declared a function as follows: create=(name,agfdf,gender)=>({name,a,gender}); (name,agfdf,gender)=>({name,a,gender}) the argument passed ...
0
votes
0answers
21 views

i want to validate all the array in one object has unique items through ajv

{ [{ type: 'personal' address: ['1','2'] }, { type: 'business' address: [2,3] }] } how can validate all the arrays address object, in this case , address ...
1
vote
0answers
8 views

display chart with chartJs, chartJs only when 2 id selected not showing result of one sided, otherwise single or multiple record selected works

i am using this chart example where i updated query in data.php with working "SELECT student_id,student_name,marks FROM tbl_marks WHERE student_id IN(1, 2, 3)" not working "SELECT student_id,...
0
votes
0answers
8 views

resize image from a stream using sharp

How can we possible resize the image from a stream ? using the sharp library ? http://github.com/lovell/sharp Code exports.getVehicleImageProfile = function (req, res) { gfs.findOne({ filename:...
0
votes
2answers
20 views

Javascript async promises as macrotasks

In my application at some point I queue so many microtasks through promises that the UI gets blocked and becomes unresponsive. Is there any way I can queue them as macrotasks in a similar way? Using ...
1
vote
0answers
9 views

How to apply the color using color picker rgb value and using events of the renderer element in 3d model obj using Three js

Need to paint color using rgb value in the pixels of the 3d obj. I refered the below link http://www.cartelle.nl/deathpaint/study/ I need the output as in the above link I need an elaborated ...
0
votes
4answers
49 views

Change color of TouchableOpacity in React Native

Can anyone help me. This is my source code: http://snack.expo.io/rJFgyPDpH Idea is that, if I click to "1 Button" it should be 'red' and if I click to "2 Button" is also should change its color to '...
0
votes
2answers
14 views

Return multiple Promises (Firebase Cloud Functions)

I have a firebase cloud function that adds a newly authenticated user into the Firestore Database. Current Function exports.createUserAccount = functions.auth.user().onCreate((user) => { ...
-1
votes
1answer
28 views

Regex that ignores a part of the string

I'm trying to find html tags in a text, like this: '<span style="background-color: #aaaaaa">' But the color part can change ( like to #bbbbbb )... I think I can use regex for this, right? But ...
0
votes
1answer
40 views

Is it possible to put a render function inside a for loop in express?

So i am rendering a webpage after i go through a for loop but the problem is that when i put the render inside the for loop, the same page gets renders multiple times which ends up giving me the error:...
0
votes
2answers
52 views

Repeat an ellement until it covers all the screen

I would like to have an html/css element being repeated until it covers the the whole screen. How can I repeat it and stop only on the screens height, but not repeat it forever? #container{ height: ...
0
votes
1answer
47 views

get dynamically generated form data in array

I am adding multiple inputs by sizes array that looks like this [ { _id: "1", size: "Size 1", price: 2 }, { _id: "2", size: "Size 2", price: 4 } ] In the form like this <...
0
votes
1answer
25 views

New to programming, trying to solve this Isogram kata (using .match javascript)

I started to learn programming about a month ago. and just started some kata's on codewars for practice. currently on this one. http://www.codewars.com/kata/isograms/javascript An isogram is a ...
1
vote
2answers
35 views

How to subtract two readonly array in Typescript

We know we can't concat readonly array in Typescript, But we can do this readonly ArrA = [1, 2, 3] as const; readonly ArrB = [4, 5] as const; readonly Arr = [...ArrA, ...ArrB]; So addition is done,...
-4
votes
1answer
21 views

Uncaught SyntaxError: Invalid or unexpected token in script

var abc = "<?php $this->db->where('tv_schedule_status', 'Active'); $this->db->where('tv_schedule_source', 'facebook'); $this->db->order_by('tv_schedule_date', 'asc'); echo $result ...
0
votes
0answers
22 views

Can't echo out a .load() ajax function in php

$commentid = $row['comment_id']; $commentidedit = "edit" . $commentid; echo "<div id = '" . $commentidedit . "'>"; echo "<button id ='". $commentid . "' value =" . $commentid . ">"; echo "...
1
vote
0answers
33 views

async for await logic return issue

So i am having a few issues trying to figure out how to fix the snip below. As of right now it is returning the values before the 'request(scanurl,.....' section of the for of loop is running. The ...
0
votes
0answers
6 views

Returning a loaded GLTF object before adding it to the scene

I have been trying various ways to do something like this: I want to load a model and then have the function return it var loader = new THREE.GLTFLoader(); loader.crossOrigin = true; var loadedModel ...
-2
votes
0answers
12 views

Need help on using random to get a random string from array

I already know how to pull random from an array but this won't work. Trying to make an HTML game. I use Caret. I'm pretty new to coding but know most of the basics. function person() { ... ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞