读书人

Cognos小结五(JavaScript)

发布时间: 2012-10-07 17:28:51 作者: rapoo

Cognos总结五(JavaScript)
1、屏蔽IE8浏览器点击折线出现热点问题
<script>
var areaObjs = document.getElementsByTagName('area');
for(var i = 0; i < areaObjs.length; i++){
var el = areaObjs[i];
if(el.attachEvent){
el.attachEvent('onfocus', function(){
el.blur();
});
}
}
</script>
2、Cognos报表屏蔽报表右键功能
<SCRIPT type="text/javascript">

if(window.oCV_NS_)
{
window.oCV_NS_.bCanUseCognosViewerContextMenu = false;
window.oCV_NS_.bCanUseCognosViewerSelection = false;
}
if(window.oCVRS)
{
window.oCVRS.bCanUseCognosViewerContextMenu=false;
window.oCVRS.bCanUseCognosViewerSelection = false;
}

function shield_rightclk()
{
if(window.oCV_NS_)
{
window.oCV_NS_.bCanUseCognosViewerContextMenu = false;
window.oCV_NS_.bCanUseCognosViewerSelection = false;
}
if(window.oCVRS)
{
window.oCVRS.bCanUseCognosViewerContextMenu=false;
window.oCVRS.bCanUseCognosViewerSelection = false;
}

}

function block(oEvent)
{
shield_rightclk();
if(window.event)
{
oEvent=window.event;
oEvent.returnValue=false;
}
else
{
oEvent.preventDefault();
}
}
document.oncontextmenu=block;

</SCRIPT>

读书人网 >操作系统

热点推荐