Dynamic URLs in CSS/JS

后端 未结 9 893
别跟我提以往
别跟我提以往 2021-02-05 16:14

I\'m splitting up one of my larger apps and introducing a \'cdn\' url to house common objects like CSS, javascript, and images to avoid duplication. What I need to do, though, i

9条回答
  •  孤城傲影
    2021-02-05 16:25

    When using relative URLs, you can force a "base" url. In the tag, use . Then, every relative link "/style.css" will point to "http://cdn-dev.example.com/style.css"

    For reference: http://www.w3schools.com/TAGS/tag_base.asp

提交回复
热议问题