I have an HTML file with the URL localhost/dir1/dir2/file.html
. In this file I send data through jquery to the server.
$('#element').live("change", function(){
$.ajax({
url: "localhost/dir1/dir3/file.php",
type: "POST",
data: { esp: $(this).val() },
success: function(result){
$("#element2").html(result);
}
})
I get an error due to jquery send the data to localhost/dir1/dir2/localhost/dir1/dir3/file.php
but I need send the data to localhost/dir1/dir3/file.php
.
How can I do this?