i have an unexpected token : but i dont know why this is.
the code where it is happening.
<script type="text/javascript">
$('.delete-btn').click(function() {
$.ajax(function() {
type: 'POST',
url: 'ajax.php',
data: { filename: filename },
success: function(return) {
if(return == 'SUCCESS') {
$this = $(this).closest('tr');
$this.remove();
}
}
});
});
</script>
I hope someone can find why i get the unexpeded token : at the url: 'ajax.php', rule.
The syntax error is in your success
callback. You've named the argument return
, which is a reserved word. Call it something else.
Niet here, merging my answer into this one to complete the picture:
Change:
$.ajax(function() {
To:
$.ajax({
Pay closer attention to what you're writing :p
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments