To keep my ZF project as portable as possible I make use of the baseUrl to
construct paths. However, today I'm facing a problem as I need to make a
reference to the baseUrl in my javascript file for an Ajax call. I'd rather
not work with an absolute path. What's your suggestions on this matter?
Here's my jQuery function. As you see it has an absolute path in it. I'm not
sure how to construct relative paths inside my javascript file so it can
find the correct zend framework action.
$.ajax({
type: "GET",
url: "http://localhost/project-test/httpdocs/ti/deletepic/pic/"
+$pic+"/format/json",
dataType: "json",
beforeSend: function(){showLoading();},
success: function(json){hideLoading(json),emptyPicField();}
});
--
View this message in context:
http://www.nabble.com/How-to%3A-relative-paths-inside-javascript-files-tp20443450p20443450.html
Sent from the Zend Framework mailing list archive at Nabble.com.