Relative path or url for html src and href attributes

前端 未结 4 1933
天涯浪人
天涯浪人 2020-12-12 02:32

Using a framework makes it easy to list full url\'s for my html src and href attributes, and I feel I\'m being more thorough by listing a full url instead of a relative path

4条回答
  •  囚心锁ツ
    2020-12-12 02:54

    'Never' (alsmost never) use absolute paths.

    It will bite you in the ass later.

    For example when you switch / add another domain.

    Go from your test to production server.

    Basically the rule is internal URL's should be relative.

提交回复
热议问题