Carl Barrett
Carl Barrett

Reputation: 229

JQuery SyntaxError: missing : after property id

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');
});

Upvotes: 0

Views: 6472

Answers (2)

bipen
bipen

Reputation: 36531

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
});

Upvotes: 0

Denys Séguret
Denys Séguret

Reputation: 382132

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}.

Upvotes: 6

Related Questions