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
  •  | 
  •  

Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top