简体   繁体   English

Sys.WebForms.PageRequestManager add_pageLoaded和性能

[英]Sys.WebForms.PageRequestManager add_pageLoaded and performance

I'm having a problem and it shows up in all browsers but is more evident in IE 9 than anything more modern. 我遇到了问题,它出现在所有浏览器中,但在IE 9中比任何更现代的功能都更加明显。

I am loading a page using ASP.NET (in some pages there is an update panel). 我正在使用ASP.NET加载页面(某些页面中有一个更新面板)。 I have the following method: 我有以下方法:

$(document).ready(function() {
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(Refresh);
});

which refreshes page elements. 刷新页面元素。 There appears to be a second / sub-second delay though between the time the page has finished loading and the time the first JavaScript method is execute. 从页面加载完成到执行第一个JavaScript方法之间,似乎有第二秒/亚秒的延迟。 I wanted to include a loading indicator (basically just pop up a div), for example immediately on page paint. 我想包括一个加载指示器(基本上只是弹出一个div),例如立即在页面上绘制。 What happens though is the page visibly loads, then there is the small delay, then the indicator (which disappears almost immediately as all JS has executed). 虽然发生了什么,但是页面明显可见,然后有一个小的延迟,然后是指示符(随着所有JS的执行,指示符几乎立即消失)。 I'm thinking the delay might be when the page is painting but I am looking for suggestions. 我认为延迟可能是在页面绘画时出现的,但我正在寻找建议。 The end user does not want to see the page before the DOM elements have been adjusted using JS. 在使用JS调整DOM元素之前,最终用户不希望看到该页面。

Thanks in advance. 提前致谢。

I worked around this by setting the loadingIndicator's CSS behavior outside of the pageLoaded event (as I assume it is waiting for the DOM to complete loading). 我通过在pageLoaded事件之外设置loadingIndicator的CSS行为来解决此问题(因为我假设它正在等待DOM完成加载)。 This appears to have resolved my problem, thanks. 谢谢,这似乎已经解决了我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Sys.WebForms.PageRequestManager pageLoaded 事件缓存 function? - Sys.WebForms.PageRequestManager pageLoaded event caching function? 'Sys.WebForms.PageRequestManager' 是 null 或不是 object - 'Sys.WebForms.PageRequestManager' is null or not an object 更新了ASP.NET 3.5到4.0 - > Sys.WebForms.PageRequestManager未定义 - Updated ASP.NET 3.5 to 4.0 -> Sys.WebForms.PageRequestManager is undefined 在IE11中,Sys.WebForms.PageRequestManager是未定义的错误,在IE10及以下版本中正常工作 - Sys.WebForms.PageRequestManager is undefined error in IE11, working fine in IE10 and below Sys.WebForms.PageRequestManager.getInstance(); - Sys.WebForms.PageRequestManager.getInstance(); 使用Sys WebForms PageRequestManager进行异步交互 - Assyncronous interaction using Sys WebForms PageRequestManager object 文字和 Sys.WebForms.PageRequestManager.getInstance().add_endRequest 问题 - object literal and Sys.WebForms.PageRequestManager.getInstance().add_endRequest issue Sys.WebForms.PageRequestManager.getInstance()在IE 10中不起作用 - Sys.WebForms.PageRequestManager.getInstance() not working in IE 10 更新面板刷新后如何执行javascript(无法获取Sys.WebForms.PageRequestManager.getInstance()。add_endRequest();工作) - How to execute javascript once an update panel refreshes (Can't get Sys.WebForms.PageRequestManager.getInstance().add_endRequest(); to work) 在IE 10和Windows 8中不支持Sys.WebForms.PageRequestManager.getInstance() - Sys.WebForms.PageRequestManager.getInstance() not supporting in IE 10 and windows 8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM