Your javascript is wrong.
you need to move initialization dataoutside of ajax call.
plus URL must be specified .. (between ')
var data = {};
data["username"] = "u";
data["password"] = "p";
this can also be represented using
var data = {'username': 'u', 'password': 'p'};
and challenge
$.ajax({
url: 'https://www.myurl.com/json.php',
dataType: 'json',
data: data,
success: function(json){
}
});
Your json is wrong
it should be {"didwork":true,"userid":123}
URL- , , , -