i wanted to know that can we send a request using ajax.like can we use domain name with file in URL property of ajax? if no then what to use instead of this ?
$.ajax({
url:'http://www.domain.com/myfile.php',
})
thank you
i wanted to know that can we send a request using ajax.like can we use domain name with file in URL property of ajax? if no then what to use instead of this ?
$.ajax({
url:'http://www.domain.com/myfile.php',
})
thank you
Yes, the url can be a full url or a relative one.
jQuery.ajax()
documentation has some examples of that.
$.ajax({
type: "POST",
url: "http://www.domain.com/myfile.php",
success: function(msg){
alert( "Data Saved: " + msg );
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("some error");
}
});