I don't think its possible, but I wanted to check with the 'experts'.
I only have CSS access to a site, is there anyway using CSS I can force in a JS file?
Thanks.
I don't think its possible, but I wanted to check with the 'experts'.
I only have CSS access to a site, is there anyway using CSS I can force in a JS file?
Thanks.
It looks, like your question is a duplicate of Import JavaScript files with CSS.
According to related post, it is not possible to load js file using @import rule inside css file.
CSS file can trigger loading following resources:
Any attempt to return js script in response to css stylesheet request, will result in css parse errors in the browser.
Bad idea, but you can use behavior (Work on IE9)
<html>
<head>
<style>
body {
behavior: url('script.htc');
}
</style>
</head>
<body>
</body>
</html>
And "script.htc":
<script type="text/javascript">
alert('hello world!');
</script>