admin管理员组文章数量:1305577
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);
});
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);
});
Share
Improve this question
edited Jul 31, 2021 at 22:43
xXx
1,1611 gold badge11 silver badges24 bronze badges
asked May 2, 2012 at 12:25
user1359453user1359453
751 silver badge7 bronze badges
1
- It looks like you're confusing Javascript and PHP syntax. Is there any reason you're preceding a Javascript variable name with $? It is valid, but I think it's much less mon, unless it has some specific meaning. – Travesty3 Commented May 2, 2012 at 12:36
1 Answer
Reset to default 8Use +
to concatenate strings, not .
, which means addressing object's property in JavaScript and, understandably, requires a property name.
本文标签: javascriptmissing name afteroperator error needs fixingStack Overflow
版权声明:本文标题:javascript - missing name after . operator error needs fixing - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741793730a2397810.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论