Is there a way to access a JavaScript String variable in the CSS part of the HTML?
For example, I've got a prefix that keeps occuring in all image URLs. It would only be proper to set a common variable with the prefix, for code maintenance. I'm looking for something like this:
<script type="text/javascript">
var dropBoxPrefix = 'https://dl.dropboxusercontent.com/s/XXXX';
</script>
<style>
html, body {
background-image: url(dropBoxPrefix + '/bg.gif');
}
.re {
background-image: url(dropBoxPrefix + '/header-bottom-left.png');
}
ul li {
background-image: url(dropBoxPrefix + '/ok.png');
}
.networksTtl {
background-image: url(dropBoxPrefix + '/Maps.png');
}
</style>