I am trying to have a form add a comment to the database with ajax. The problem I am having is that ajax cannot find the url because of how my current url is structured
url.com/thread/id
I am trying to have the ajax request sent to
url.com/ajax_comment
If I enter the whole URL it works correctly. However I need to avoid doing so as this script will be installable on multiple domains. So how can I accomplish this without hard coding the url in?
Is there a structure in javascript, similar to PHP where you can do include('./folder/file.php');
or there is another method to accomplish this?