jquery - Absolute urls in html file - running in server and locally -


i have set absolute paths images in website. directory structure below:

root

 client   -- images      ---a.png   -- index.html 

so if use a.png in index.html set src "/client/images/a.png". works fine in server. since files pure html have lost liberty of double clicking , running html files. in case paths broken. understand reason - how browser know root directory? there way work around runs both ways or need run external tool?

it's hard what's going on without seeing html source, should able use relative urls.

so if want access /client/images/a.png /client/index.html page, use url "./images/a.png" image.

the dot @ beginning saying start in our current directory, , subdirectory "images" file "a.png". can use ".." tell @ parent directory if need go 1 or more levels, such if had access in client folder.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -