2017-02-17 148 views
0

以下是我迄今为止隐藏div内容所做的代码。但不幸的是,它不适用于在线CRM。在Dynamics CRM中隐藏div内容

function hideSocialEmailErrorMsgBlock() { 
     debugger; 
     var _errorMsgBlock = document.getElementById("emailnotification"); 
     var _warningMessage = document.getElementById("warningmessage"); 
     if ((errorMsgBlock == null && errorMsgBlock == undefined) || (warningMessage == null && warningMessage != undefined)) 
     { 
     setTimeout(hideSocialEmailErrorMsgBlock, 1000); 
     return; 
     } 
     else 
     { 
     document.getElementById("emailnotification").innerHTML = ''; 
     document.getElementById("warningmessage").innerHTML = ''; 
     // code has to be placed here... 
     // $("#warningmessage").hide(); 
     // $("warningmessage").attributes("style.display","none"); 
     // $("emailnotification").attributes("style.display","none"); 
     //$("#emailnotification").hide(); 
     setTimeout(hideSocialEmailErrorMsgBlock, 1000); 
     } 
    } 

这是前端的形象。

enter image description here

这里是网页的图像。

enter image description here

我要隐藏的错误显示在网页上。

+0

你想永久隐藏它吗? – Varun

+0

让我们说是,然后呢? –

+1

你可以用CSS隐藏它,'.emailnotification {display:none!important; }' – Varun

回答

1

如果你想完全隐藏与Javascript您emailnotification DIV,你可以使用:

的document.getElementById( 'emailnotification')的style.display = '无'。

这会比试图隐藏所有文本更简单。

+0

或者您可以使用.hide()函数尝试使用jquery。 –