What does
/.*=/,''
mean in
var id=this.href.replace(/.*=/,'');
?
Full code
function delete_subscriber(){
var id=this.href.replace(/.*=/,'');
this.id='delete_link_'+id;
if(confirm('Are you sure you want to delete this subscriber?'))
$.getJSON('delete.php?ajax=true&id='+id, remove_row);
return false;
}
I assume it is regex, but I have little knowledge about it.
It’s a regular expression.
The specific syntax here is as follows (comments after the
#s):The rest of it is a function that replaces anything that is matched by this regular expression and remove it.