Dee*_*dav 3 javascript coldfusion
我将getXmlHttpObject变量的a.cfm中的text-area值传递给b.cfm页面并在a中显示值.如何将我在a.cfm页面的文本区域中输入的文本精确格式化为b.cfm页面的div.
a.cfm
<textarea name="sum1#i#" id="sum1#i#" html="yes" cols="98" rows="5"></textarea> [my text area]
url=url+"?dept="+iden+"&desc="+encodeURIComponent(desc); [desc: value of text area]
b.cfm
<cfoutput>
<div style="border:1px solid">#URLDecode(desc)#</div>
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
就像我发送价值'hellothere'encodeURIComponent:'你好%0Athere'
但它出现在'你好那里'[在一行]我希望它在:'你好<break-line>那里'[在两个不同的行中,意思是与文本区域中的格式相同]
谢谢!!!
小智 5
该<pre></pre>标签将保留空格和换行.
<cfoutput>
<div style="border:1px solid"> <pre>#URLDecode(desc)#</pre> </div>
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
462 次 |
| 最近记录: |