多重加载功能 [英] multiple onload function

查看:52
本文介绍了多重加载功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在体内提供两个onload功能.

I want to give two onload function in body.

<BODY onLoad="init();update()" >


这可以正常工作,但会在所有页面上触发. IE会显示错误.
如果我在正文中使用id,则在内容页面中使用


this works fine but it fires for all page . so IE shows error.
if i use id in body then use in content page

protected void Page_Load(object sender, EventArgs e)
    {
        Masterpages_MasterPage masterPage = this.Master as Masterpages_MasterPage;
        masterPage.Body.Attributes.Add("onLoad", "photoGallery();");
    }



它工作正常,但是如果我在母版页中使用



it works fine, but if I use in masterpage

protected void Page_Load(object sender, EventArgs e)
    {
        Body.Attributes.Add("onLoad", "startTime();");     
    }


masterpage-works,内容页不起作用.


masterpage-works , contentpage does not work.

推荐答案

您需要研究javascript事件链来处理此问题.

http://juixe.com/techknow/index.php/2007/06 /20/chain-javascript-events/ [
You''ll want to investigate javascript event chaining to handle this.

http://juixe.com/techknow/index.php/2007/06/20/chain-javascript-events/[^]


这篇关于多重加载功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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