jQuery的:移动的JavaScript到页面底部? [英] jQuery: Move JavaScript to the bottom of the page?

查看:117
本文介绍了jQuery的:移动的JavaScript到页面底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发大量含有ASCX控制dynmically创建的页面的大ASP.NET应用程序。我们在任何地方使用了大量的jQuery。

We are developing large ASP.NET applications with lot of dynmically created pages containing ASCX controls. We use a lot of jQuery everywhere.

我一直在读,这将是有意义的内联的JavaScript code移动到页面的底部,因为它可能延迟网页的加载时,它包括为时尚早。

I have been reading that it would make sense to move the inline JavaScript code to the bottom of the page as it could delay the loading of the page when it's included "too early".

我的问题是现在?使用jQuery时,这是否还有意义

大部分code的在准备处理执行的,所以我希望这是页面的加载不会减慢。
在我的情况下多用户控件的 ASCX都自己的jQuery 的点点滴滴,这是不容易移动,所有倒在呈现的页面。

Most of the code is executed in the ready handler, so I would expect that is does not slow down the loading of the page. In my case the multiple Usercontrols ASCX have all their own jQuery bits and pieces, and it would not be easy to move that all down in the rendered page.

推荐答案

您可以订购的JavaScript不同的方式在模型Cuzillion 来看看它是如何影响页面加载速度。

You could model the different ways of ordering the JavaScript in Cuzillion to see how it affects page loading.

查看范例和的这个博客帖子获取的页面元素的顺序是如何影响速度的例子。

See the examples and this blog post for examples of how ordering of page elements can affect speed.

这篇关于jQuery的:移动的JavaScript到页面底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆