Hello, guys, my ajax only works on localhost, what am I missing? Thank you.
Ajax.js
var url = "http://localhost/sistema/";
function criaAJAX() {
if (window.XMLHttpRequest)
{// Codigo para IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
} else
{// Codigo para IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
;
Non-html script ...
<script type="text/javascript">
$('#search-usuarios').keyup(function () {
var chars = (this.value);
$.post(url + 'Ajax/busca-usuarios', {val: chars}, function (busca) {
$('#content-left').html(busca);
});
});
</script>