I’m trying to load some data via jQuery.getJSON() but it does not work:
here is my JSON:
{didwork=true,userid=123}
or it is
{didwork=false,userid=0}
here is my Javascript:
$.ajax({
data["username"] = "u"
data["password"] = "p";
url: https://www.myurl.com/json.php,
dataType: 'json',
data: data,
success: function(json){
//fill it into div
}
});
your json string is wrong. it has to be
or
never use
=and always use"