The webserver will pull local stuff regardless of relative or absolute links.
However, instead of : "http://www.myserver.com/directory/images/img.jpg"
why not use : "/directory/images/img.jpg" - using the pre-slash it does not matter about the root url since HTML/PHP/JavaScript will now reference from the root and not the relative directory.
However, instead of : "http://www.myserver.com/directory/images/img.jpg"
why not use : "/directory/images/img.jpg" - using the pre-slash it does not matter about the root url since HTML/PHP/JavaScript will now reference from the root and not the relative directory.