When I use an AJAX request in a JavaScript file, for example:
... url: "request.php" ...
When I'm in place (rewritten URL):
http://example/some/action/id/
And JavaScript is located and linked in meta tags with:
... src="http://example/js/ajaxrequest.js" ...
Then, is the request sent to http://example/some/action/id/request.php or http://example/js/request.php ?
If I change the request URL to /request.php instead of request.php , will it always go to http://example/request.php ?
If I have two working environments, http://localhost/projectname/ and http://projectname.com/ , and the file structure always looks like this ( projectname.com is a copy of the directory with the project name):
http://localhost/projectname/js/ajaxrequest.js http://localhost/projectname/request.php http://projectname.com/js/ajaxrequest.js http://projectname.com/request.php
And I can be on the main page and also rewrite URLs such as:
http://localhost/projectname/ http://projectname.com/ http://localhost/projectname/some/action/id/ http://projectname.com/some/action/id/
And I want this URL to be requested in the JavaScript file, will it work under all these conditions, or should I put an address like url: "../request.php" in the JavaScript file?