ajax - Send data to absolute URL with jQuery -
i have html file url localhost/dir1/dir2/file.html. in file send data through jquery 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 error due jquery send data localhost/dir1/dir2/localhost/dir1/dir3/file.php need send data localhost/dir1/dir3/file.php. how can this?
change url to:
/dir1/dir3/file.php this avoids hardcoding protocol , server code.
Comments
Post a Comment