I wonder whether someone can help me please.
I’ve put together this page which allows users to view a gallery of their uploaded images.
I’m now working on the deletion functionality, so that users can delete any image. From some really useful guidance from members of this site here, I’ve been looking at the jQuery POST method, unlinking the images from the server where they’re stored.
From their guidance and subsequent research I’ve been doing, I think I can use the relative path i.e. $path.
I’ve come up with the following which I’ve tried to add to my script:
<script type="text/javascript">
Galleria.ready(function() {
this.$('thumblink').click();
$(".galleria-image").append(
"<span class='btn-delete ui-icon ui-icon-trash'></span>");
$(".btn-delete").live("click", function()
{ var img = $(this).closest(".galleria-image").find("img");
alert('Deleting image... ');
$(this).closest(".galleria-image"). fadeOut('slow');
$.ajax({
type: "POST",
url: "$path",
}
});
return false;
});
});
Unfortunately though, I’ve clearly done soemthing wrong because this has affected my gallery functionality and it no longer works. Perhaps, because I’m quite new to this, I’ve looked at it too simplistically, I’m not sure.
I just wondered whether someone could perhaps have a look at this and let me know where I’ve gone wrong.
Many thanks and kind regards
Your brackets don’t match after the
which is probably why the javascript is broken.