使用jsp动态包含时Onload可以提前触发吗?
当 jsp 页面包含 jsp 动态包含...
<jsp:include page=”filename.jsp” />
...文档 onload 事件(或原型的 dom:loaded 事件)是否可能被过早触发? (即在包含的 filename.jsp 完全加载之前)
我怀疑这种情况的原因可能是包含的文件是单独编译的,并且仅在运行时由指令包含。父 jsp 可能会假设指令本身的加载足以考虑 DOM 已加载 - 包含页面是异步加载的,并且文档可能不会监视其加载。
这是一个合理的担忧吗?
提前致谢
When a jsp page includes jsp dynamic includes...
<jsp:include page=”filename.jsp” />
...is it possible that the document onload event (or prototype's dom:loaded event) could get fired too early? (i.e. before the included filename.jsp has fully loaded)
The reason I suspect this may be the case is that the included file is compiled separately and only included by directive at runtime. The parent jsp might assume that loading of the directive itself is sufficient to consider the DOM is loaded - the includes page is loaded asynchronously and its loading is might not be monitored by the document.
Is this a valid concern?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这包括服务器端,而不是客户端。这当然不是异步的。客户端收到一个响应。右键单击页面并查看源代码。都是纯 HTML。
如果您在加载时遇到问题,那么它就在其他地方。验证/验证生成的 HTML 输出。
This is included serverside, not clientside. It's certainly not asynchronously. The client receives one response. Rightclick page and view source. It's all plain HTML.
If you have problems with onload, it lies somewhere else. Verify/validate the generated HTML output.