php - How to manipulate URL inside ajax call? -
i trying trigger ajax call on change of dropdown menu(at client_script.php). ajax call send values server_script.php , change div section of client_script.php. problem server script kept in local directory such blocks/latestgrades/server_script.php. when ajax call done url becomes address of server_script.php prepended
http://localhost/umoodle
which quite ok, because server_script/php file location such. when hover around other pages, onchange triggeres ajax call tries find server_script.php on location prepended
http://localhost/umoodle/<something_i_dont_want_here>/
how alter url cut place dont want , ajax call that?
make sure ajax url absolute url (beginning forward slash) formed root instead of relative current page. example: (url: '/umoodle')
Comments
Post a Comment