如何运行master Page onload方法 [英] How to run master Page onload method

查看:75
本文介绍了如何运行master Page onload方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我在我的项目中使用母版页面和主页面的上传我正在调用javascript函数来改变这样的背景



母版页设计

Hello All,

I am using master page in my project and onload of master page i am calling a javascript function to change the background like this

Master Page design

<body id="sitebody1" onlod ="noBack();">

Javascript Funtion
<script type="text/javascript">
   
    function noBack() {
                var ThemeName = getCookie("ThemeName");
        var imgbg = jQuery(this).attr('dir');
        if (ThemeName != "") {
            $('#sitebody1').css({ backgroundImage: "url(" + ThemeName + ")" });
        }
            
    } 
</script



呈现子表单时,只在某个表单上调用此javascript函数,而在其他表单上工作正常。



请帮帮我。

提前致谢。


When child form is rendered then this javascript function is called only on some form while on other is works fine.

Please help me.
Thanks in advance.

推荐答案

' #sitebody1')。css({backgroundImage: url( + ThemeName + });
}

}
< / script
('#sitebody1').css({ backgroundImage: "url(" + ThemeName + ")" }); } } </script



呈现子表单时,只在某个表单上调用此javascript函数,而在其他表单上工作正常。



请帮帮我。

提前致谢。


When child form is rendered then this javascript function is called only on some form while on other is works fine.

Please help me.
Thanks in advance.


也许我弄错了,但你的问题似乎在于你的html body标签。你有onlod =noBack();当它应该是onload =noBack();。似乎你不小心把onlod而不是onload
Maybe I am mistaken, but your problem seems to lie in your html body tag. You have onlod ="noBack();" When it should be onload ="noBack();". Seems you accidentally put "onlod" instead of "onload"


这篇关于如何运行master Page onload方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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