的Javascript安置和CSS的aspx页面 [英] Placement of Javascript and CSS in aspx page

查看:89
本文介绍了的Javascript安置和CSS的aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以给我建议,我应该把我的JavaScript和CSS code在我的aspx页面。 ?一开始还是结束?请问Ja​​vaScript和CSS的错误的位置影响页面的优化?

Can anyone suggest me where should I put my javascript and css code in my aspx page. ? In the beginning or at the end? Does the wrong placement of javascript and css affect the optimization of page?

推荐答案

它的更好,如果你在不同的文件有两个人,然后将它们包括在你的aspx页面。这样,它将使您能够使用多个页面相同的CSS和Javascript。

Its better if you have both of them in separate files and then include them in your aspx page. This way it will enable you to use the same CSS and Javascript on multiple pages.

但是,如果你正在寻找使用CSS和Javascript中只有一个页面,然后
你应该把在头标记你的CSS,你可以把头部标记或HTML之间的任何地方,但是把JavaScript是head标签之间最好的地方之间的JavaScript。它能够更好地把像的jQuery JS库头文件。

But if you are looking to use the CSS and Javascript in only a single page then You should put your css in head tag, You can put javascript between head tag or any where between html but best place to put javascript is between head tags. Its better to put js like jquery libraries file in head.

这篇关于的Javascript安置和CSS的aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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