如何在发生页面加载时在javascript中引发事件 [英] How to raise an event in javascript when a pageload occurs

查看:52
本文介绍了如何在发生页面加载时在javascript中引发事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在发生页面加载时在javascript中引发事件?





如何在javscript中替换下面的代码?



code :

How to raise an event in javascript when a pageload occurs ?


How to Replace the below code in javscript?

code:

protected void Page_Load(object sender, EventArgs e)
       {




if (!IsPostBack)
            {



}

}


}
}

推荐答案

在head标签中尝试这个jquery函数: -

try this jquery function in head tag:-
<script type="text/javascript">


(document).ready(function(){
alert(in page load);
});
< / script >
(document).ready(function () { alert("in page load"); }); </script>


<body onload="script();">






Or

document.onload = function ...






Or

window.onload = function ...



你可以使用jquery并使用


you could use jquery and use


这篇关于如何在发生页面加载时在javascript中引发事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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