I am trying to write a plugin and in this plugin, it needs to know its current position in the whole file system. I tried the code like below:
var Path = location.hostName + '/wp-content/plugins/myplugin/';
but when I use this plugin in a post named 'test', the Path turns out to be:
http://www.mywebsite.com/blog/test/undefined/wp-content/plugins/myplugin/
How can I correct this and make it like:
http://www.mywebsite.com/wp-content/plugins/myplugin/
I am not sure if I have put it clear. Please help...thank you very much.