如何防止Coldfusion将cfform.js注入head部分?
HTML 模板被传递到 Coldfusion。模板的 head 标签具有附加属性:
<head profile="http://abc.com">
问题是,当基于此模板生成输出时,Coldfusion 将其脚本注入 head 标签内:
<head <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
profile="http://abc.com">
这会导致 profile="http://abc.com">< /code> 显示在页面顶部并阻止页面验证。
仅当存在表单标签时才会发生代码注入。如果 head 标签没有任何属性,则不会发生错位注入。该属性的存在是项目要求,不能省略。
是否可以阻止 Coldfusion 注入脚本?
An HTML template is passed to Coldfusion. The head tag of the template has additional attribute:
<head profile="http://abc.com">
The issue is that when generating the output based on this template Coldfusion injects its scripts inside the head tag:
<head <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
profile="http://abc.com">
This causes profile="http://abc.com">
to appear on the top of the page and prevents page from validation.
The code injection occurs only when there is a form tag. The wrong-place injection does not happen if the head tag does not have any attributes. The presence of the attribute is a project requirement and cannot be omitted.
Is it possible to prevent Coldfusion from injecting the scripts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
脚本注入仅发生在 cfforms 中,而不是标准表单中。如果您没有使用 cfform 的任何增强功能,则只需切换到标准表单即可。
我检查了累积修补程序列表,没有看到对此的修复。
The script injection only happens for cfforms, not standard forms. If you aren't using any of cfform's enhancements, you can simply switch to a standard form.
I checked the cumulative hotfix list, and didn't see a fix for this.
我的解决方案:将元标记放在
CF 创建页面之后,它将标记放置在标记下方但上方
My Solution: Put the meta tag right after the
when CF creates the page it puts the tag below the but above the tags