English 中文(简体)
JSF和骨干/骨干/骨干/骨干.js - 双引逃跑
原标题:JSF and backbone/underscore.js - double-quote escaping

我使用Flacelet的JSF应用程序中的主干字框和强调字框模板。

现在的问题是 模板表达式中的双引号

<script type="text/template">
  {{ if (x == "foo") }} 
  ....
</script>

正在像 一样逃跑 。

避免这种情况的最好办法是什么?

如果我把lt;!!! [CDATA[ 作为我 lt; statiming> 标签中第一件事, 那么我在模板输出中也看到 CDATA

如果我试图将模板放入外部的.js 文件,那么Eclipse会因为模板不是 Javascript 代码而强烈抱怨。

我想也许可以把模板放进另一个文件 外加一个不同的扩展名,而不是.js?

最佳回答

尝试在 >f:verbatim 中包装您的 Javascript 代码 :

<f:verbatim>
 <script type="text/template">
  {{ if (x == "foo") }} 
  ....
 </script> 
</f:verbatim>
问题回答

暂无回答




相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签