![]() ![]() ![]() I was able to verify this "nuance" using two (2) lines of CFML.Įnter fullscreen mode Exit fullscreen mode The only difference we could determine was that the staging environment used CF2016 whereas development used CF2021. but why? We also had the entire codebase hosted on a staging environment and it worked there, but not in production. It was immediately obvious to us that the unsafe, inline onclick JavaScript events were failing because dependencies weren't being referenced. We checked the HTML source and determined that JavaScript files weren't even being included in the source code. to be blogged about later) reported an issue where they were experiencing JavaScript errors on their webpage. This "append-and-output-later" approach has worked well for us with our internal homegrown framework, but not so well for other developers that indiscriminately use CFHTMLHead and publicly reference different CFM files in URLs with different entries & random exits points.Īnother developer (who uses our jsoupUtil library. During the "end of the page" request, we flatten these arrays to strings, audit them to determine which dependencies should be injected and then add the final content payload to the head section. (Using the request scope allows us to easily inject JS/CSS/metatags/etc from any CFTags, UDFs, CFC, etc.) When we want to add anything to the HTML Head section (or jQuery's onReady method), we append it to these arrays. Our approach, since CF8/9, was to create two (2) request-scoped array variables: request.extraHtml and request.extraOnReady. Ben Nadel warned about potential issues in his Thoroughly Document Your Use Of ColdFusion's CFHTMLHead Tag blog article back in 2009. If it's used in multiple places throughout the life of a web request, it can cause some havoc. ![]() Our framework doesn't use CFHTMLHead until the very end of the request process. It's possible that it's either a bug or they intentionally changed it (for security reasons) and then neglected to document it. I'm not sure why Adobe changed this behavior. I've compared this behavior with latest versions of CF2018 and Lucee (and even CF2016) and they all faithfully continue to retain & output the header buffer. Prior to CF2021, any strings that were added to the header buffer via CFHTMLHead was outputted to the HTML HEAD section (or top of the page if you neglected to include a HEAD section) on onRequestEnd even if a CFContent (with or without reset) was performed.Īfter upgrading to CF2021.0.0 (or even latest v5), I've discovered that the header buffer is cleared whenever performing CFContent. According to my unit tests, after ColdFusion 2018.0.0-15, Adobe changed the way that CFHTMLHead works with CFContent. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |