我有一个.xml.config文件,我需要添加将某些变量传递给对象的JS。
<!-- BEGIN: GUARANTEE -->
<span id="imageSpan"></span>
<script type="text/javascript" src="//mysite.com/Web/Seal/gjs.aspx?SN=953625677"></script>
<script type="text/javascript">
if (window._GUARANTEE && _GUARANTEE.Loaded) {
_GUARANTEE.Hash = "ZlUp0GQc2wW0JHvn%2F6XdQ4TR3IxlFbVCS52UG%2Fl2g%2FnPc31yD9Vzcbnx3ZTbkCS6oeX9twjSsE1Jrb7hr8RWQw%3D%3D";
_GUARANTEE.Guarantee.order = '<xsl:value-of select="/root/Runtime/OrderNumber"/>';
_GUARANTEE.Guarantee.subtotal = '<xsl:value-of select="/root/Orders/Order/OrderSubtotal"/>';
_GUARANTEE.Guarantee.currency = '<xsl:value-of select="/root/Runtime/CurrencySetting"/>';
_GUARANTEE.Guarantee.email = '<xsl:value-of select="/root/Orders/Order/Email"/>';
_GUARANTEE.WriteGuarantee("JavaScript", "imageSpan");
}
</script>
<!-- END: GUARANTEE -->
我发现了一个错误,我想,&amp;迹象。我尝试在js代码之前添加<![CDATA[]]>
但仍然收到错误。
我应该逃避<xsl: value-of select="" />
标签以外的所有内容吗?
如果有人能提供一些很棒的指导。
答案 0 :(得分:0)
你说你试过在js代码之前添加<![CDATA[
,但这对任何事都没有帮助。
正确的表单是在js代码之前添加]]>
,在&
之后添加。{/ p>
或者,是的,逃避<
标志。 (并且为了完整性,还有所有>
符号,甚至所有@Directive({
selector: "[autoScroll]"
})
export class AutoScroll {
@Input() inScrollHeight;
@Input() inClientHeight;
@HostBinding("scrollTop") outScrollTop;
ngOnChanges(changes: {[propName: string]: SimpleChange}) {
if (changes["inScrollHeight"] || changes["inClientHeight"]) {
this.scroll();
}
};
scroll() {
this.outScrollTop = this.inScrollHeight - this.inClientHeight;
};
}
符号,这些符号在某些情况下可能会导致问题。)