Even though this particular question has been asked and answered multiple times, I am still struggling to find a solution to my problem.
I am currently working with Masterpages and JavaScript files, and as many people are aware, Masterpages can be quite tricky when it comes to dealing with relative paths.
One of the things I am using is a png fix known as Unit Png Fix, which I have found to be very effective - even more so than the JQuery alternative. However, this fix requires a small image called clear.gif, and the path to this file is stored within a variable in the JavaScript file.
Due to the complexities of Masterpages, I cannot simply open the JS file and input a static path as I had originally thought.
My attempted solution was to remove the variable from the JS file and declare it outside, but within the same Script block. Here is an example:
<!--[if lt IE 7]>
<script src="<%= ResolveClientUrl("~/masterpages/js/unitpngfix.js") %>" type="text/javascript">
var clear="<%= ResolveClientUrl("~/masterpages/img/clear.gif") %>";
</script>
<![endif]-->
I even tried declaring it in the Head section of the website (I typically place my JS files at the bottom of the page for faster loading).
Unfortunately, neither of these solutions worked for me, which is why I am posting this question here. :(