Question

After reading some of the other questions on here and trying their solutions, I still have this issue with XQuery.

We are using a conditional comment to see if IE is being used. We are dynamically building paths to our javascript files like so.

<!--[if lte IE]>
<script type="text/javascript" src="{$layout:cdnPath}/scripts/browser-detect-admin.js">&nbsp;</script>
<![endif]-->

But it seems that the script element is being evaluated as text and not building the correct path to our javascript. It is thinking that {$layout:cdnPath}/scripts/browser-detect-admin.js is the path to the file. I can't figure out why.

I tested this in IE 7,8 and also in IE 9 compatibility mode.

Was it helpful?

Solution

That is correct. Such expression templates are not evaluated within literal comment. Use a comment constructor instead:

comment {concat('[if lte IE]>
<script type="text/javascript" src="', $layour:cdnPath, '/scripts/browser-detect-admin.js">&nbsp;</script>
<![endif]')}

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top