额外的html,我没有写 [英] extra html that I did not write

查看:183
本文介绍了额外的html,我没有写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序有一个错误 - 输出有额外的垃圾,它不属于那里。 Firebug显示我的代码行,会产生完全不需要的垃圾,但我没有这些行在我的程序。我花了几个小时这个,不能解决它。这是Firebug说我有(波浪括号中的东西是我的意见:

 < tr> 
< ; td class =repnumstyle =width:20px> 1< / td> {td 1}
< td class =reprowstyle =text-align:left;& Maura< / td> {td 2}
< td class =reprowstyle =text-align:left;> Cronin< / td> {td 3}
< td class =repsort subhead>< / td>找不到这个位置
< / tr>
< tr>找不到这个位置
< td class =repsort2 subhead < / td>找不到此位置
< / tr>找不到此位置

我的程序的一部分如下,实际的程序有其他ColdFusion的东西,但没有额外的HTML。

  tr> 
... other stuff ...
< cfloop from =#subpage1#to =#subhind_1#index =j>
< cfif sortnum [j] EQ'y'>
< cfif subhdup [j] [row] EQNO>
< cfset ctr [j] = 1>
< cfelseif subhdup [j] [row] EQYES>
< cfset ctr [j] = ctr [j] + 1> < cfloop from =#subpage1#to =#subhind_1#index =j>
< cfif sortnum [j] EQ'y'>
< cfif subhdup [j] [row] EQNO>
< cfset ctr [j] = 1>
< cfelseif subhdup [j] [row] EQYES>
< cfset ctr [j] = ctr [j] + 1>
< / cfif>

< td class =repnumstyle =width:20px> #ctr [j]#< / td> td 1
< / cfif>
< / cfloop>


< cfloop from =#subhind#to =#bbcollen#index =j>
< cfset col = bbcol [j]>

< cfset i = i + 1>
< cfif linefold GT 0>
< cfset imod = i%linefold>
< cfelse>
< cfset imod = 1>
< / cfif>

< cfif linefold EQ 0 OR(linefold GT 0 AND i LE linefold)>
< cfset lineclass =reprow>
< cfelse>
< cfset lineclass =reprow2>
< / cfif>

< cfif repdetail NEQ'n'>
< cfoutput>
< cfset jcol = inpcol [j]>
< cfset temp = structaux [#jcol#InputType]>

< cfif temp EQnumOR temp EQone>
< cfset anumform = NumberFormat(qrep [col] [currentrow] ,. 99)>
< td class =#lineclass#style =text-align:right> #anumform#< / td>
< cfelseif temp EQdate>
< cfset adate = DateFormat(qrep [col] [currentrow],'mm / dd / yyyy')>
< cfif adate EQ01/01/1001>
< cfset adate =〜>
< / cfif>
< td class =#lineclass#style =text-align:left> #adate#< / td>
< cfelse>
< td class =#lineclass#style =text-align:left;> #qrep [col] [row]#< / td>

< / cfif><!--- temp eq num --->

< / cfloop> < ;! --- subhind to bbcollen --->
... other stuff ...
< / tr>

有人有建议吗?






根据要求扩展了代码



有人说这是关于空格。不是这样。如果它是空白我会没事的。但是我有各种各样的css掉进那些额外的空间,创造边界等。它真的产生一个难以辨认的混乱。

解决方案

ColdFusion不会生成< tr> < td> ,除非代码如此。

通常,额外的空格不重要,不会改变浏览器上显示的内容。



如果你有一个地区不能有空格,请添加< cfsilent> make以删除空格生成。


My program has a bug -- the output has extra junk in it that doesn't belong there. Firebug shows me lines of code that would produce exactly this unwanted junk, but I don't have those lines in my program. I have spent hours on this and cannot solve it. Here is what Firebug says I have (the stuff in wavy brackets are my comments:

<tr>
<td class="repnum" style="width: 20px">1 </td>                {td 1}
<td class="reprow" style="text-align: left; "> Maura</td>     {td 2}
<td class="reprow" style="text-align: left; "> Cronin</td>    {td 3}
<td class="repsort subhead"> </td>                   cannot find this anywhere 
</tr>
<tr>                                                 cannot find this anywhere
<td class="repsort2 subhead "> </td>                 cannot find this anywhere
</tr>                                                cannot find this anywhere

Part of my program below. The actual program has other ColdFusion stuff in it, but no additional HTML.

 <tr>
   ... other stuff ...
 <cfloop from = "#subpage1#" to = "#subhind_1#" index = "j"> 
 <cfif sortnum[j] EQ 'y'>
   <cfif subhdup[j][row] EQ "NO">
   <cfset ctr[j] = 1>
   <cfelseif subhdup[j][row] EQ "YES">
   <cfset ctr[j] = ctr[j] + 1> <cfloop from = "#subpage1#" to = "#subhind_1#" index = "j"> 
   <cfif sortnum[j] EQ 'y'>
   <cfif subhdup[j][row] EQ "NO">
   <cfset ctr[j] = 1>
   <cfelseif subhdup[j][row] EQ "YES">
   <cfset ctr[j] = ctr[j] + 1>
   </cfif>

   <td class = "repnum" style = "width: 20px">#ctr[j]# </td>  td 1
 </cfif>
 </cfloop>


<cfloop from = "#subhind#" to = "#bbcollen#" index = "j">
<cfset col = bbcol[j]>

 <cfset i = i + 1>
       <cfif linefold GT 0>
       <cfset imod = i%linefold>
       <cfelse>
       <cfset imod = 1>
       </cfif>

       <cfif linefold EQ 0 OR (linefold GT 0 AND i LE linefold)> 
       <cfset lineclass = "reprow">
       <cfelse>
       <cfset lineclass = "reprow2">
       </cfif> 

      <cfif repdetail NEQ 'n'>     
      <cfoutput>
      <cfset jcol = inpcol[j]>
      <cfset temp    = structaux["#jcol#InputType"]> 

      <cfif temp EQ "num" OR temp EQ "one"> 
        <cfset anumform = NumberFormat(qrep[col][currentrow],.99)>
           <td class = "#lineclass#" style = "text-align: right"> #anumform#</td> 
      <cfelseif temp EQ "date">
           <cfset adate = DateFormat(qrep[col][currentrow],'mm/dd/yyyy')>
              <cfif adate EQ "01/01/1001">
              <cfset adate = "~">
              </cfif>
           <td class = "#lineclass#" style = "text-align: left"> #adate#</td> 
      <cfelse>
            <td class = "#lineclass#" style = "text-align: left; "> #qrep[col][row]#</td>

      </cfif><!---temp eq num --->

</cfloop> <!---subhind to bbcollen --->  
  ... other stuff ...
</tr>

Does anyone have a suggestion?


as per request I had expanded the code presented

Someone said that this is about whitespace. It is not. If it were whitespace I'd be okay. But I've got all sorts of css dropping into those extra spaces, creating borders etc. It really produces an illegible mess.

解决方案

ColdFusion will not generate <tr> or <td> unless the code says so.

Normally extra white space is not significant and will not alter what is shown on the browser.

If you do have a region that must not have space, add it <cfsilent> make to remove space generation.

这篇关于额外的html,我没有写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆