Category "javascript"

Cannot read property length of undefined in Datatables

I'm trying to show some data on a Datatable. The data is called from an Ajax request and the response is a Json array, it looks like this: [{"item": "one", "pr

How to auto-compress Images while uploading image in angularjs

Here is my HTML form: <form name="myForm" ng-submit=""> <input ng-model='file' type="file"/> <input type="submit" value='Submit'/&

Show progress on html file input?

I want to show a progress bar or spinner when I choose a file for upload, I'm not talking about server upload success, I already got that covered, I want to sho

yarn command not found after installing via npm

As per the yarn installation for yarn v2, they want you to install using npm install -g yarn. So I ran sudo npm install -g yarn on Ubuntu 20.04. But after I d

How to have a searchbar in "Select" Component native-base

I would love to have a search bar in "Select" component from the library native-base in react-native. I have tried adding a "TextInput" component inside the "Se

AJAX POST not sending request to express.js server with body-parser due CORS problem

I'm trying to make an AJAX POST request from my html page which runs on an apache server. The request is needed to POST a filename to the express.js server and

How to add multiple classNames to nextjs elements

I have an unordered list element that looks like this: <ul className={styles["projects-pd-subdetails-list"]}> {detail.subdetails.map((sub) =&

Need help on a react.js error that I keep on getting

Every time I try running npm start on a new project I keep on getting this error. Does anyone know or have any idea how to fix this?? There might be a problem

How to add scroll into react-bootstrap Modal.Body

I'm using react-bootstrap modal. How can I make only body to scroll and not all the page? <Modal.Dialog> <Modal.Header> <Modal.Titl

Inject CSS styles inside of the shadow-root instead of the head tag | Vue.js & Webpack

I'm making an embeddable widget for websites using Vue.js and vue-custom-element. Everything was going smoothly until I ran into a problem. When I'm trying to u

Abort form submission on AJAX beginform with JavaScript

I am working with .NET MVC. My problem is that I need to abort an AJAX call if a JavaScript statement is true. <div class="Filter_inner_title white_unifrom o

How to get or call Javascript var in HTML object tag or HTML embed tag from parent html page?

I have embedded a codmirror html file by 3 different way such as iframe tag, embed tag and object tag inside another html file on the same server. <!-- The C

How to style slides on the edges in Swiper slider

I'm using Swiper slider plugin (https://swiperjs.com). And I need to add opacity 0.5 to slides on the edges of visible viewport. https://i.stack.imgur.com/A6nr5

How to make binary tree from array in javascript?

I have an array var array = [8,10,12,5,3,6]; Logic First node would be root node. If new node value is less or equal =< than parent node, It would be left

Is destructing assigning in JavaScript shallow or deep copy?

I'm confused by the destructing assigning in JavaScript about shallow and deep copy. For example, const obj = {key:{}, value:{}} let {key} = obj key = {msg: 'he

innerHTML disappearing quickly after displaying

I was trying to make a "find and replace" page and my code is working properly except that the resulting string is only displayed for a split second before it d

How to rewrite costum Gdpr cookie consent jquery code snippet into pure javascript

I need help with Gdpr cookie consent Jquery code snippet below to rewrite it into pure javascript. Can any one please help me rewrite it into pure javascript? T

Display distance to marker in AR.js

I'm trying to display the distance to text markers (underneath the markers) in AR.js; according to the docs, distanceMsg is a custom attribute from gps-entity-p

Discord oauth2 /users/@me/guilds error 401

It is supposed to get all the guilds a user is joined in. It gets the bearer auth right, but it always errors with code 401. When using a external API (https://

wallet-connect importKey error when uploaded to test server, but local server it works fine

I was trying out wallet-connect for my nft market place app . i have mostly everything set up from my end . Just that my wallet-connect works perfectly in local