2016年6月21日 星期二

CRM2011 JavaScript Load up CSS file

CRM2011 JavaScript Load up CSS file



1.Attach the following code to the web resource






2.Add the function to the priority on-change and to form onload (Call the function in an existing onload)



function OnLoadForm(){

    this.LoadCSS("/WebResources/css_form_opportunity.css");

}



function LoadCSS(path) {

    var head = document.getElementsByTagName('head')[0];

    var link = document.createElement('link');

    link.rel = 'stylesheet';

    link.type = 'text/css';

    link.href = path;

    link.media = 'all';

    head.appendChild(link);

}




沒有留言:

張貼留言