special-code | 这里存放着江程训写的瞎几把炫酷的特效,Amen
kandi X-RAY | special-code Summary
kandi X-RAY | special-code Summary
这里存放着江程训写的瞎几把炫酷的特效,Amen~
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of special-code
special-code Key Features
special-code Examples and Code Snippets
Community Discussions
Trending Discussions on special-code
QUESTION
I'm really out of practice on my JS and I'm trying to incorporate a "delete" mechanism into some existing code that displays rows of data. If it were straight PHP I'd have no problem but it's got some JQuery and other random JS stuff. Here's the code:
...ANSWER
Answered 2018-Feb-06 at 00:46The Ajax at the top is for submitting the form and calling add.php, but you want an Ajax that calls delete.php. Since you've already written the first Ajax, you should know how to write the second Ajax. So will not touch that part, and will only answer your questions.
what I need to do is call a "delete.php" on every row via a button or anchor link.
Bothe will work. However, if you go with links, you've got to cancel their default behavior like you did with the submit
button using e.preventDefault();
in the click
event.
Seems like I should enumerate the rows somehow so that said link has an identifier (like , etc.), and perhaps I could use innerhtml to read what is in those id's.
You can do that, but I would store the ID in a data-id
attribute of each link. Something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install special-code
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page