I’m getting error using the following code snippet
jQuery(document).ready(function() {
jQuery.ajax({
url: url,
type: 'POST',
username: id,
password: pass
}).success(function(content) { alert('ok'); })
.error(function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.status); alert(XMLHttpRequest.readyState); alert(textStatus); })
.complete(function() { alert('done'); });
});
something like that should work. You don’t just put username and pass in the ajax argument, you creata a
dataobject and put the parameters in there. Also, you put your callbacks as arguments in theajaxargument.