Hope my title is clear...am part of a team that works with CodeIgniter. The HTTP links are in this fashion: www.abc.com/content www.abc.com/content/edit/2
Now, we have some javascsript ajax functions that are shared thru out various sections of the application. One is this:
Expand|Select|Wrap|Line Numbers
- function getXtime() {
- var result = "";
- $.ajax({
- type: "GET",
- async: false,
- url: "../tools/getcname",
- data: "{}",
- contentType: "application/json; charset=utf-8",
- dataType: "text",
- success: function (msg) {
- result = msg;
- },
- error: function (jqXHR, textStatus, errorThrown) {
- result="";
- }
- });
- //alert("returnValue"+paramList);
- return result;
- }
It works for those urls that are www.abc.com/content format as it the URL is correctly appended. For other format links, it doesn't work as it tries abc.com/content/edit/tools/getcname
We don't want to use absolute URLS as the application will be used in various departments with varioius urls but same website structure.
Is there a short way to solve this?