Is it possible that JQuery to modify URL's in side a CSS or Javascript resource before its loads into the browser. Or at least as it loads in the browser?
URL usually pointing to resources, like images, fonts etc.
Basically I am thinking of this idea since I usually do large Single page web app/website which during development resources root path is relative, but in production the root path points to some other URL.
Is there something that solve this kind of problem? I am thinking like having a javascript that checks:
(psuedo-code)
var isDevMode = true;
if (isDevMode) {
root_path = "/";
} else {
root_path = "http://somewhere.com/"
}
So I just set it and all the path in my very big and complex HTML file, including the CSS in the page gets the right root path.
.replace(). Then append it to head like thisbackground:url('./images/body_bg.png');