My site layout (for this example):
localhost/mydomain/
-localhost/mydomain/pics
-localhost/mydomain/somepages/arandompage.php
I want to access picture from here:
localhost/mydomain/index.php
I did this:
<img id='4' src='pics/somepic.1.jpg'>
The mouseover snippet:
{ $('#'+someId).attr('src', 'pics/somepic.'+num+'.jpg');
This is working. But when I wanted to access it from here it doesn’t work.
But when you go localhost/mydomain/somepages/arandompage.php
it obviously doesn't work, no longer relative.
<img id='4' src='../pics/somepic.1.jpg'>
Ok here obviously that'll fix the display image. It is not working in JavaScript.
{ $('#'+videoId).attr('src', '../pics/somepic.'+num+'.jpg'); /
I don't know what to do here, but yes all I need is the JavaScript to just look back 1 folder to get that img src. That's all. If you answer please insert what should be here in:
`{ $('#'+videoId).attr('src', ====> 'pics/somepic.'+num+'.jpg');`
So that it goes to the parent directory.
P.S. I tried absolute paths but to no avail either.