我正在从堆栈中编写html文件。这有点痛苦,因为对于每一行,如果文件包含引号,我必须编写如下所示的内容。
write "<div id=hidden-" & quote & myKanton & quote && "style=" & quote & "display:block;" "e&&"class=" "e & "popuptable" "e& ">" & LF to file tOutputFileCH 现在,我不得不再次添加大量html代码,我想知道是否有一种更简单的方法可以执行这样的操作:
write escaped("my html numbers and "txt" with quotes") to file我不需要html文本中的变量。
发布于 2014-05-13 10:29:18
通常,人们使用的函数如下
function q theText
replace "'" with quote in theText
return theText
end q它可以用作
write q("<div id=hidden-'" & myKanton & "' style='display:block;'" & "class='popuptable'>" & LF) to file tOutputFileCH 您可以使用上例中的字符串,但也可以使用任何容器:
get q(myVariable)
put q(it) into field 1
put q(field 1) into field 2
put q(url myUrl) into url myOtherUrl
put q(the cProperty of me) into myVar
-- etc etc etc如果您更改了q函数,也可以使用“或”代替“。
顺便说一下,我注意到在引号中没有包括hidden-。你确定这是对的吗?
发布于 2014-05-13 10:33:04
HTML允许使用引号和单引号,所以您可以.
put "<div style='border:1px'>" into tHTMLLiveCode的格式命令允许您转义双引号..。
put format("my html numbers and \"txt\" with quotes") into tData发布于 2014-05-13 12:33:39
现在起作用了。我将html行放在自定义堆栈属性中,并在编写文件时将其用作输入。效果很好。如果没有Q函数,它似乎也能工作。
write ( the cMapOverlay of stack "AfaConverter" ) & LF to file tOutputFileCH 我也试过因为
onmouseover="nhpup.popup($('#hidden-VS').html(), {'width': 400});" href="./kantone/index_kanton_VS.html" 这是没有适应性的q的麻烦,因为‘被替换成’,这是一个问题。
https://stackoverflow.com/questions/23628301
复制相似问题