[jQuery] Adding function argument into jquery

[jQuery] Adding function argument into jquery


I wrote a small script that brings up a confirm dialog, and if the
user clicks ok, it will hide a div, and then post a URL. I am using
the assetid argument from my function, and I want to use that with the
jquery .hide function, but it does not seem to work. What have I done
wrong? It seems like it is not passing assetid into the .hide()
function.
<script type="text/javascript">
function deleteAsset(message, action, assetid, asseturl) {
var confirmDelete = confirm(message);
if (confirmDelete == true) {
if(action == "delete") {
//Add jQuery function to hide the asset from the users view
$(assetid).hide();
$("#announceItemFull").html("");
//Use ajax to post the URL so that our trigger will delete
the selected asset
$.ajax( {
type : "POST", url : asseturl + "?action=delete" }
);
}
}
}
</script>
<a href="#" onclick="deleteAsset('Do you really want to delete
this?','delete','a221','http://www.puc.edu');">Delete</a>