I am getting this error on the error console and can’t seem to figure it out, I tried taking out the quotes, moving them around but still can’t solve the error which is : missing name after . operator. How can this error be fixed?
var counter = 0;
counter++;
result = '<span class="imagemsg'+counter+'">The file was uploaded successfully!</span><br/><br/>';
...
jQuery.ajax("deleteimage.php?imagefilename=" + image_file_name)
.done(function(data) {
$(".imagemsg".counter).html(data);
});
Use
+to concatenate strings, not., which means addressing object’s property in JavaScript and, understandably, requires a property name.