哪一页上的javascript [英] javascript on which page

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

问题描述

我不知道我将javascript放在主页还是子页上.
请帮助我.

I do not know where I put javascript whether on master page or child page.
Please help me.

推荐答案

我不会将其放在任何页面上.对JavaScript使用单独的文件,并在必要时添加链接引用.

如果JavaScript被多个页面使用,则将引用添加到母版页.如果仅在一页上使用,请放在那儿.非常简单.
I wouldn''t put it on any page. Use a separate file for the JavaScript and add a link reference where necessary.

If the JavaScript is used by more than one page then add the reference to the masterpage. If used only on one page, put it there. Very simple.


这不是我们可以回答的问题!

这取决于您需要的位置-如果您需要母版页元素中的内容,则它必须位于母版页上.
如果仅在单个页面上需要它,那么最好仅在该页面上.

就我个人而言,我使用了一种组合:一些在母版上,一些在子版上.
That is not a question we can answer!

It depends where you will need it - if you need it from master page elements, it needs to be on the master page.
If you only need it on a single page, then it is best on just that page.

Personally, I use a combination: some on the master, some on the child.


这篇关于哪一页上的javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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