Skip to content

Tag: javascript

Drag multiple divs with javascript

I’m interested in dragging some divs by clicking in their header. I followed instructions of W3SCHOOL https://www.w3schools.com/howto/howto_js_draggable.asp and some advices founded in the web. This is my actual code: I’ve created a Jsfiddle that works with entire divs. I would like this result bu…

I want to redirect to a new page on react on a conditon

Error:Line 33:13: Expected an assignment or function call and instead saw an expression no-unused-expressions I used the Route and Browser Router to create the link to the page. I need to redirect to the home page on signing in. Answer As you are not using state anywhere, you can add redirect instead of setti…

Calling javascript from php file failed

I have three different files: index.html, app.js, app.php. On HTML element <a href=”./files/sweetsencrypt.pdf” onclick=”return decrypt(this.href);”>Decrypt Sweets</a> I am calling javascript function in which I am giving ajax call to PHP: Till this everything is okay. When …

Focus trap for multiple modals

I’m working on a trap focus modal functionality and it works well with a single element, but I can’t get it working with multiple elements. It traps focus only on last modal. I know there is something wrong with my loop, I tried to catch activeElement and add a condition if it’s equal to foc…

Send data to mysql database

I am trying to replace the data in a MySQL row. I have the code for the user to sign up, and when they sign up they are assigned an id and their “plannerTable” is set to null. I know how to receive the data from the users row, but how do I replace the data in the users “plannerTable”?