最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JQuery SyntaxError: missing : after property id - Stack Overflow

programmeradmin2浏览0评论

So simple, not seeing the problem. Can someone take a look for me. Thanks.

Error: SyntaxError: missing : after property id

$(document).ready({
  $('#ajax-palaceholder').load('http://localhost/devlab/users.php');
});

So simple, not seeing the problem. Can someone take a look for me. Thanks.

Error: SyntaxError: missing : after property id

$(document).ready({
  $('#ajax-palaceholder').load('http://localhost/devlab/users.php');
});
Share Improve this question edited Apr 2, 2013 at 15:19 Denys Séguret 383k90 gold badges811 silver badges776 bronze badges asked Mar 31, 2013 at 14:45 Carl BarrettCarl Barrett 2295 silver badges16 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

You probably wanted

$(document).ready(function(){
  $('#ajax-palaceholder').load('http://localhost/devlab/quedata_v2/users.php');
});

.ready takes a function as argument.

You got this ": missing after property id" error message because {something} looks like an object literal but would normally be {propertyid:propertyvalue}.

You need a function as argument inside document.ready

Try this

$(document).ready(function(){
               //--^^^^^^---here
   //your code;

})

or the document.ready shorthand ..

$(function(){
   //your code
});
发布评论

评论列表(0)

  1. 暂无评论