开发者

How can i delete using ajax?

I have a image gallery inside a <div> which contains 10 photos. How can i delete them using ajax? I want one cross sign to appear at the top right corner of each photo and when user clicks on it, the image should get deleted. And the whole <div> should get refreshed. I do know working with jquery ajax. But i开发者_如何学运维s there any plugin available in Jquery that can this visually appealing?

Thanks in advance :)


jQuery: use the something.remove() method

DOM: use the parent.removeChild(something) method


If you are actually wanting to delete the image from the server, or from the page so that other viewers will no longer see it, then you will need to have a server URI that deletes the resource. This can be called from JavaScript, but needs a server action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜