Skip to content
Advertisement

Set active class conditionally in React

I am new to React and of course, I am facing problems, the thing I am trying to accomplish is this. When any of these Components is opened I want to set an active class. I have already tried something but it is not working. So I want to add a background color to these divs className=’menu__iconsRight ‘ when they

Return multiple queries using Apollo

I am using nextJS for my frontend with apollo and a graphql. And I fetching my queries using the getStaticProps() function. To increase modularity and maintainability I break my queries into multiple queries. I have a folder structure like: src/queries getPost.js getMenu.js getProduct.js index.js And their all queries are put and exported into index.js. The problem is because of multiple

How to make a bot edit its own message on Discord

My friend wrote this amazing code for me but it doesn’t seem to work. It’s meant to send a message on a command then edit the message over and over again. But when I run the code my terminal says DiscordAPIError: Cannot edit a message authored by another user method: ‘patch’, path: ‘/channels/808300406073065483/messages/811398346853318668’, code: 50005, httpStatus: 403 Is there a

javascript onclick form function

Helllo I have this form that take 3 different input for my app. I try to send that information to my database using API but first I want to print it out in the console to see if I got the value from the input but nothing happen, here is my Javascript code: Any ideas? Many thanks. Answer Issue Identified

Making calculator using Ajax with jQuery validator plugin but Ajax conduct submission before the validation

I’m making calculator using Ajax with validator plugin I could make calculator work but cannot implement validator to this… there are 2 issues. Since my HTML code’s button type is ‘button’ validation plugin doesn’t work. if I change this to ‘submit’ it redirect to the other page. Ajax conduct the answer before the validation! I tried beforeSubmit and submitHandler…..maybe I

Is it safe to make a POST request with JSON data using ajax?

I’m working on web application where I need to send some data using ajax with post method. So I have two choices to send data whether in JSON format or query prams. I’m confused which should I use? and is it safe to send data in JSON format? Answer As @lucasreta mentioned, if you use HTTPS, it doesn’t really matter

Advertisement