Is there a way to set window.location so that relative paths follow this instead of what is given by default window.location

StackOverflow https://stackoverflow.com/questions/23626155

  •  21-07-2023
  •  | 
  •  

문제

I have a new server and I have existing files with relative links in CSS, img tags, etc. How do i set my own window.location to be followed by such files, I am not looking for anything hectic in particular just for within my website. e.g http://stackoverflow.com and https://stackoverflow.com/questions/ I need the latter to be my site-url. I am thinking in the lines of javascript but any solution is welcome.

도움이 되었습니까?

해결책

Maybe you will be able to use the <base>-tag

<base href="http://www.example.com/">

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top