relative link in plugin ?
-
I am writing a plugin for the first time, and i have a problem.
I am using ajax in my plugin. My javascript file is in the folder ../wp-content/plugins/myplugin/js/ , and in it i am trying to call a php file, which is in the folder ../wp-content/plugins/myplugin/
jQuery.ajax({
url: “/wp-content/plugins/myplugin/myfile.php?myparam=” + myparam,
context: document.body
});My question is: How can i get this url reference work independent of, where the user installed the plugin.
Because when for example a user install this plugin in http://localhost/subdir/, the reference is not correct.
Can i somehow create a relative link ?
The topic ‘relative link in plugin ?’ is closed to new replies.