哪个代码首先在Jquery和Asp.net的上下文中执行 [英] Which Code executes first in context to Jquery and Asp.net

查看:74
本文介绍了哪个代码首先在Jquery和Asp.net的上下文中执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释先执行哪个代码?即jquery文档.ready或asp.net Page_Load方法中的代码?

这将是一个很大的帮助..在此先感谢

Can any one explain which code Executes first ? i.e Code in jquery Document .ready or in asp.net Page_Load method?

It would be a great help .. Thanks in advance

$(document).ready(function() {
      

});





protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           
        }
    }

推荐答案

(文档).ready(
(document).ready(function() { });





protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           
        }
    }


在将页面呈现为HTML之前,必须运行服务器端代码.因此,显而易见的答案是首先执行Page_Load方法.当页面加载到浏览器中时,将执行jQuery代码.更具体地说,它是在浏览器中完全加载页面时执行的页面.

最好的问候,
曼弗雷德(Manfred)
Before a page gets rendered to HTML the server side code has to run. So the obvious answer is that the Page_Load method is executed first. The jQuery code is executed when the page is loaded in the browser. To be more specific it is executed when the page has been loaded completely in the browser.

Best Regards,
Manfred


除了曼弗雷德(Manfred)所说的以外,您还应该尝试理解ASP.Net页 ^ ].
In addition to what Manfred said, you should try to understand the ASP.Net page lifecycle[^].


这篇关于哪个代码首先在Jquery和Asp.net的上下文中执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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