Вопрос

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?

Это было полезно?

Решение

You have two options:

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

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top