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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -