Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

changing background based on page url

$
0
0

HI ,

I developed a user control and added in diffrent pages .My requiremnt is to change some  td backgound based on the page urls.Please tell me how to write  that kind of function.I am writing below function and calling on page load.

function

Changecolor() {     

if(window.location.href =="/sites/abc/xyz/SitePages/MyPage2.aspx")

        {

document.getElementById('mytd').className = 'class2';

        }

        

else{

document.getElementById('mytd').className = 'class3';

         }

}

       


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>