Kohana and Javscript path
- by Leonti
Hi!
I have a following Kohana setup:
All my files are placed under 'public_html/koh'
My js files are placed under 'public_html/koh/media/js/'
I use html::script helper to include those javascript files which generates me following html code:
In my js I access one of controllers like 'json/getsomething' (which is http://localhost/koh/json/getsomething).
It works OK as long as I'm staying in top of the controller:
http://localhost/koh/home
When I go to 'http://localhost/koh/home/index' it renders the same page of course but 'json/getsomething' is not accessible from Javascript anymore.
How can I solve this problem?
Include Javascript using absolute path?
Create a variable in js like var fullPath = 'http://localhost/koh/'?
What is the best practice to do it?
Leonti