Unable to add text to HTML HEAD tag

107 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
May 7, 2014, 11:19:49 AM5/7/14
to ColdFusion Technical Talk

I'm doing some testing on my new CF10 desktop system and have run into an odd one that I can't figure out.

This program has been running OK for several years but when I ran it in CF10 it generated the error message "Unable to add text to HTML HEAD tag". It did this at the end of the page after everything else looked fine. The error line it contained was a cfjaxaproxy inside a CFWINDOW tag.

The detailed explanation says "This is probably because you have already used a CFFLUSH tag in your template or buffered output is turned off." I haven't used a CFFLUSH and my administrator is set for 1024 buffering (the default). When I comment out the CFWINDOW tag it runs fine.

The CFWINDOW is this:

<cfwindow name="Invoice" modal="true" resizable="false" title="Invoice Details"
width="320" height="300" x="500" y="170"
bodyStyle="font-size:12px; font-family: verdana; color: black; text-align: left;"
headerStyle="font-size:13px; font-weight:bold; font-family:Verdana; background-color: ##003399; color: white; text-align:left;">
<cfajaximport tags="cfform, cfwindow" scriptsrc="/CFIDE/scripts">
</cfwindow>

I took out the cfajaximport but the error just moved to another line number.

Any suggestions?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358570

hofar...@houseoffusion.com

unread,
May 7, 2014, 11:25:40 AM5/7/14
to ColdFusion Technical Talk

Suggestion #1: Stop using any and all CF UI tags. Use JavaScript, whether
you write it from scratch or rely on a JS framework such as jQuery.

Suggestion #2: Refer to Suggestion #1.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358571

hofar...@houseoffusion.com

unread,
May 7, 2014, 11:35:00 AM5/7/14
to ColdFusion Technical Talk

So you suggest going back and rewriting a 50,000 line application in order to resolve the problem? Not a very practical solution, I'm afraid.

Does anyone have a more realistic suggestion?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358572

hofar...@houseoffusion.com

unread,
May 7, 2014, 12:14:16 PM5/7/14
to ColdFusion Technical Talk

Maybe try putting the cfajaximport into the <head> portion instead of
inline elsewhere.

Byron Mann
Lead Engineer & Architect
HostMySite.com
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358573

hofar...@houseoffusion.com

unread,
May 7, 2014, 12:28:11 PM5/7/14
to ColdFusion Technical Talk

Rewrite the whole thing right now? No. I would progressively replace CF
UI tags with clean JS frameworks or custom JS as you touch each section
of your application. You'll find fewer and fewer people are using the
CF UI tags and therefore less and less assistance available. And most
of the CF UI tag problems people seek assistance with are directly
related to shortcomings/bugs in said tags that will probably never be
fixed by Adobe. Considering that the CF UI stuff is built on top of JS
libraries that are several versions (and several years) old, you are far
better off investing in implementing current versions of JS libraries
yourself and reaping the benefits of the cumulative feature
improvements/bug fixes of those libraries.

Just my $0.01 (inflation sucks, don't it)
-Carl V.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358574

hofar...@houseoffusion.com

unread,
May 7, 2014, 12:33:05 PM5/7/14
to ColdFusion Technical Talk

This. Precisely.


On Wed, May 7, 2014 at 12:28 PM, Carl Von Stetten
<vonner...@vonner.net>wrote:
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358575

hofar...@houseoffusion.com

unread,
May 7, 2014, 2:03:07 PM5/7/14
to ColdFusion Technical Talk

Apparently they are teaching these tags now in what used to be the Fast
Track to CF classes. The last position I was in, the "lead" developer there
was insistent on using them because he just learned them in the class.

Eric
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358577

hofar...@houseoffusion.com

unread,
May 7, 2014, 2:21:04 PM5/7/14
to ColdFusion Technical Talk

I don't dispute that rewriting it might be the best long term solution. And perhaps doing it in pieces is smart too (although I'd hate to be the person who had to maintain the application when it is in the middle.)

But I wasn't asking for advice on CF programming strategy, rather I was looking for help on one particular problem, after having spent a few hours with no results from searches and tests.

It annoys me (and I'm sure others) when people feel compelled to advise/lecture on programming techniques rather than discuss the issue. It also detracts from the quality of discussion because who wants to put themselves up for that criticism? Clearly anyone who advises me on my problem must be as dumb and inexperienced as I am!

I will probably get very little additional feedback on this question because of that response.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358578

hofar...@houseoffusion.com

unread,
May 7, 2014, 2:30:27 PM5/7/14
to ColdFusion Technical Talk

It's too bad you feel that way. You asked an open-ended question ("Any
suggestions?"), and I gave you the best advice I can give. If I were
personally tackling the problem you face, I would do so exactly as I
suggested. I won't apologize for that, because it is exceptionally sound
advice, and was a direct answer to the exact question you asked.
Additionally, I did not in any way, shape, or form criticize you or anyone
else, and I certainly formed no opinion on your intellect or experience
level.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358579

hofar...@houseoffusion.com

unread,
May 7, 2014, 2:53:10 PM5/7/14
to ColdFusion Technical Talk

When I taught the Advanced Class, they did cover this and the code in the
class always had the cfajaxproxy call at the top of the page, outside of
anything else.

The other option that you have if you know Ext is to access the
ColdFusion Ajax widgets directly through Javascript using the ColdFusion.
Namespace
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358580

hofar...@houseoffusion.com

unread,
May 7, 2014, 3:17:10 PM5/7/14
to ColdFusion Technical Talk

John,

Have you seen this thread? (
http://stackoverflow.com/questions/17516757/cf10-unable-to-add-text-to-html-head)
I don't know much content that you are trying to display, but have you
tried to increase the Max Output Buffer?



On Wed, May 7, 2014 at 2:21 PM, John Pullam <jpu...@mcleansystems.com>wrote:

>
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358581

hofar...@houseoffusion.com

unread,
May 7, 2014, 3:43:22 PM5/7/14
to ColdFusion Technical Talk

I do understand what you mean John, and when you just want a quick fix
these responses do seem unhelpful.
But what you do need to know is that the majority of old gits on this list
have been there, done that and learnt by their mistakes and are not in the
habit of "quick and dirty" fixes and will thus almost always suggest the
best long term term solution.
I think you will also find that any of the CF UI tags are universally hated
here, most folks have ripped their hair out trying to get them working at
some point and then given up, thus the negative responses.

In answer to your specific issue.

If you check your CFAdmin, on the settings page, there is a setting
for *Maximum
Output Buffer size*. I believe the default is 1024 KB. If your page is
bigger than this, then CF may be flushing the buffer before your closing
CFHTMLHEAD tag runs. You could try increasing the buffer size.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358582

hofar...@houseoffusion.com

unread,
May 7, 2014, 3:51:22 PM5/7/14
to ColdFusion Technical Talk

On Wed, May 7, 2014 at 2:21 PM, John Pullam wrote:

> It annoys me (and I'm sure others) when people feel compelled to
> advise/lecture on programming techniques rather than discuss the issue. It
> also detracts from the quality of discussion because who wants to put
> themselves up for that criticism? Clearly anyone who advises me on my
> problem must be as dumb and inexperienced as I am!
>

John - you really shouldn't take this sort of suggestion as a personal
attack, even if the tone of Matt's reply may have been a little short on
sugar coating.

There may be a workaround to resolve this issue but the advice is legit. I
would try to eliminate any auto-generated client side stuff in CF. Even if
you resolve this problem (and I am not even sure it's because the client
side generation stuff is out of date), you are likely to run into more down
the road. Unless the app is EOL this is unlikely to be the last problem you
have.

-Cameron

--
Cameron Childress
--
p: 678.637.5072
im: cameroncf
facebook <http://www.facebook.com/cameroncf> |
twitter<http://twitter.com/cameronc> |
google+ <https://profiles.google.com/u/0/117829379451708140985>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358583

hofar...@houseoffusion.com

unread,
May 7, 2014, 4:07:02 PM5/7/14
to ColdFusion Technical Talk

+ 1 zillion

I think the term you are looking for is one I can't post here, but
agreed 100% that "advice" like "you are doing it wrong - throw it out"
is never constructive

It's maybe a little better if the poster bothers to explain WHY it
should be thrown out

Of course you asked a specific question and rightfully should be able to
expect a decent informed response instead of a "mine's bigger than yours
and I know better than you" response like you got

Way to have the tact to respond the way you did - I didn't reply earlier
because I could not find any tact and instead wanted to speak my mind
and that would surely get me banned.

I wish I could help you, but I don't have any experience with the CF UI tags

Take care

-Bryan

*Bryan Stevenson*B.Comm.
President & CEO
Electric Edge Systems Group Inc. - makers of FACTS^(TM)
phone: 250.480.0642
cell: 250.920.8830
e-mail: br...@electricedgesystems.com <mailto:br...@electricedgesystems.com>
web: www.electricedgesystems.com <http://www.electricedgesystems.com>
and www.fisheryfacts.com <http://www.fisheryfacts.com>

------------------------------------------------------------------------

Please consider the environment before printing this e-mail

-----CONFIDENTIALITY------
This message, including any attachments, is confidential and may contain
information that is privileged or exempt from disclosure. It is intended
only for the person to whom it is addressed unless expressly authorized
otherwise by the sender. If you are not an authorized recipient, please
notify the sender immediately and permanently destroy all copies of this
message and attachments.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358584

hofar...@houseoffusion.com

unread,
May 9, 2014, 6:05:12 PM5/9/14
to ColdFusion Technical Talk

I appreciate the feedback received on this and some of the ensuing discussion.

On the technical side, it was a cfajaximport tag on which it failed. But as I mentioned earlier, it still failed when that tag was removed. Thanx to one suggestion I got it to work by moving the entire cfwindow up (but still inside the body tag). I had already looked at all those articles that have been mentioned and none of them did a thing or applied to my case. But I appreciate the suggestions because if I hadn't done my research before posting, that would have given me more useful things to do.

FWIW, I have been there and done that too (been a programmer for nearly 50 years) so I believe I'm qualified to participate in the discussion about giving help. My concern is that on any number of posts I read, I have found some responders who prefer to give technique advice rather than deal with the issue at hand. Yes, I know that some folks need that, but often the tone of the response comes across like I'm smarter than you. If the responder had the sensitivity to phrase their words like "you may already know this, but what you are doing is no longer considered best practice in the industry" it would be a lot easier to handle. But derailing a thread into a discussion of what is a better practice rarely helps get the issue solved in short term.

On the specific issue of the CF UI stuff, I agree that most of it is poor. I have wasted numerous hours myself and thrown away things like cfgrid. Fortunately, apart from the differences from CF8 to CF9, the cwindow code has been excellent in my apps so I am in no hurry to rewrite all that code.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358609

hofar...@houseoffusion.com

unread,
May 9, 2014, 8:35:57 PM5/9/14
to ColdFusion Technical Talk

> FWIW, I have been there and done that too (been a programmer for nearly 50 years) so I believe I'm qualified
> to participate in the discussion about giving help. My concern is that on any number of posts I read, I have
> found some responders who prefer to give technique advice rather than deal with the issue at hand. Yes, I
> know that some folks need that, but often the tone of the response comes across like I'm smarter than you.
> If the responder had the sensitivity to phrase their words like "you may already know this, but what you are
> doing is no longer considered best practice in the industry" it would be a lot easier to handle. But derailing
> a thread into a discussion of what is a better practice rarely helps get the issue solved in short term.

My advice to you - which you are of course free to take or leave - is
that you read responses in the most positive way you can. You're
asking for technical help, not sensitivity. And, in my own experience,
a lot of technical questions boil down to the old joke "it hurts when
I do this" - to which the right answer is usually, "don't do this".
You can't expect people not to tell you that when you ask for free
help, even if it may not be what you want to hear.

Going back to Matt's original response, I suspect the only person he
feels smarter than is his younger self - you know, the one that used
all that generated code and had to maintain it and wished someone had
told him what a mistake that would turn out to be. Lots of us wish we
could go back in time and tell our younger selves not to do things
that seemed perfectly reasonable at the time, but turned out to be
huge mistakes.

Dave Watts, CTO, Fig Leaf Software
1-202-527-9569
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358610
Reply all
Reply to author
Forward
0 new messages