Question

In a multilanguage website when changing the img.src attribute in jQuery, it looks for base url + src which becomes something like http://localhost/app/en/resources/images/img.jpg assuming base url is http://localhost/app/en/ and src is resources/images/img.jpg
In fact the img.jpg file is not under en folder so this should be omitted from the above location.
How can I do this?

Was it helpful?

Solution

You have two options:

  1. Give the absolute URL: http://www.google.com/...../image.png

  2. Give relative URL, two folders up: ../../image.png

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top