ASP.Net 和JavaScript:元素

发布于 2024-11-30 05:46:19 字数 178 浏览 4 评论 0原文

我记得上学期我的老师在我的 ASP.Net 文档的 HEAD 部分提到了如何对 JavaScript 命令进行排序,但我在笔记中却找不到它。对于 HEAD 部分中的 Java 顺序和其他语句是否有特别关注?

我将 Javascript 放在基于母版页的 .aspx 页面上(如果这有什么区别的话)。

提前致谢!

I remember my instructor last semester mentioning something about how to sequence JavaScript commands in the HEAD section of my ASP.Net document, but for the life of me, I can't find it in my notes. Are there special concerns about the order Java and other statements inthe HEAD section?

I am putting the Javascript on a .aspx page that is based on a Master Page, if that makes any difference.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2024-12-07 05:46:19

不,顺序并不重要。而且你也不需要将 JS 放在 HEAD 部分,除非你引用外部 JS 文件。如果您使用母版页,并且需要在页面上使用特定的 JS 函数,只需在页面上创建 JS 函数,并使用必要的脚本标签:

ASPX:

<script language="javascript" type="text/javascript">
    someFunction = function(){
        //do something
    }
</script>

No, the sequence doesn't really matter. And you don't need to put your JS in the HEAD section either, unless you're referencing an external JS file. If you're using master pages, and you need a certain JS function on a page, just create the JS function on the page, with the requisite script tags:

ASPX:

<script language="javascript" type="text/javascript">
    someFunction = function(){
        //do something
    }
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文