prestashop_newuser Posted January 28, 2014 Share Posted January 28, 2014 Hi, Currently I am working in a small module. In that I have a small query where I need ajax. For that I did my code like this function deleteAttribute(id) { var id = id; $.ajax({ type: "GET", url: baseDir + "/modules/mymodule/php/deleteteAttribute.php", cache: false, data: { id : id }, success: function(html) { $(".success").html(html); } }); } Here you can see I have used baseDir to get the directory path. But in console tab of firefox it is showing ReferenceError: baseDir is not defined . So can some one kindly tell me how to fix this issue? Any help or suggestions will be really appreciable. Thanks Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2014 Share Posted January 28, 2014 hello where you use this code? front office / back office? Link to comment Share on other sites More sharing options...
prestashop_newuser Posted January 28, 2014 Author Share Posted January 28, 2014 hello where you use this code? front office / back office? I am using this code in backoffice. Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2014 Share Posted January 28, 2014 this is why it does't work. back office hasn't got baseDir variable Link to comment Share on other sites More sharing options...
prestashop_newuser Posted January 28, 2014 Author Share Posted January 28, 2014 this is why it does't work. back office hasn't got baseDir variable Then how can I get the baseDir for backend? How to fix it? Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2014 Share Posted January 28, 2014 just don't use it. back office doesn't use friendly urls, so you can use relative paths Link to comment Share on other sites More sharing options...
Recommended Posts