cf10 unable to add text to HTML Head

前端 未结 4 1069
慢半拍i
慢半拍i 2021-01-04 10:20

I am getting the following error on a page we are loading:

coldfusion.runtime.CfErrorWrapper 
Unable to add text to HTML HEAD tag. 
[empty string] 

caused b         


        
4条回答
  •  隐瞒了意图╮
    2021-01-04 10:44

    I've run into the same problem recently but the behavior wasn't predictable. I believe that Dan Short's answer is correct. I created some test pages to see if I could reproduce the problem. Each time TestTemplate.cfm is included, CFHTMLHEAD writes a simple JavaScript alert to the head tag. Once the buffer is reached, and the page is automatically flushed, any subsequent CFHTMLHEAD tag use will result in an error, specifically, the error in the original post. As Dan indicates, you can work your way around this issue by changing the maximum output buffer size.

    file: index.cfm

    
    Test Page
    
     
    cfset Count = 0>
     
     
     
    
    
    

    file TestTemplate.cfm

    
    
    
    

    Count #Count#

    j = randRange(i, 1000000); k = randRange(i, 1000000); l = j * k; writeOutput(l);

    file sample.js

    alert('Boo!');
    

提交回复
热议问题