There is an image inside HTML page. I use Jquery for 360 grad rotation. My Jquery plugin gets the list of all images via AJAX request. But the problem is, that I don't know where the user will locate scripts ang images.
For example images will be located at home/mypage/public_html/gallery/pictures/ and scripts at home/mypage/public_html/scripts/rotate/. I have an option for user to show the path to scripts and want the script to get images path automatic, based on first image path.
For example I have some image with relative path:
<img src='pictures/001.jpg'>
url is: mypage.com/gallery/pictures/001.jpg
How can I get a path to containing folder in form:
home/mypage/public_html/gallery/pictures/
It's no matter to do it with Jquery or PHP
a PHP script then loads all images from home/mypage/public_html/gallery/pictures/
Thx!