Click here to Skip to main content
15,886,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
HTML
<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

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.
Posted
Updated 19-Oct-15 20:54pm
v3
Comments
Sreekanth Mothukuru 20-Oct-15 9:18am    
Try to call the noBack function within the page simply at the end of script section..

noBack();
Member 8232678 20-Oct-15 23:53pm    
i already try this.

1 solution

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"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900