I’m trying to do an AJAX request using Jquery.
The JS file is located here:
root/templates/wooden_tpl/scripts/script.js
I try to request data from this file using this function:
$.post('ajax/get_blog_info.php',function(data){
alert(data);
});
The file is in this directory:
root/templates/wooden_tpl/scripts/ajax/get_blog_info.php
For some reason this doesn’t work.
The file which is including the script.js is contained in the root.
My assumption is that javascript doesn’t include relative to it’s current pass. True?
Thanks.
Important is the context where the javascript is executed. And this is the context of the including file, thus you have to use the including page’s path.