Wednesday, August 13, 2008

Make IFRAME Disabled / ReadOnly


//Paste the code inside the entity onload event box

var IFRAME_Test;
var IFRAME_Test_Disable_Message = "IFRAME Disabled...";

function OnCrmPageLoad() {
//Reference the IFRAME
IFRAME_Test = document.all.IFRAME_Test;
//Bind to its ready state event (wait until the iframe is fully loaded)
IFRAME_Test.attachEvent( "onreadystatechange" , OnTestIframeReady );
}

function OnTestIframeReady() {
if( IFRAME_Test.readyState != "complete" )
return;
//Override the onmousedown event
IFRAME_Test.contentWindow.document.onmousedown = OnTestIframeMouseDown;
}

function OnTestIframeMouseDown() {
alert( IFRAME_Test_Disable_Message );
/* or use */
//the window is put beyond the user's desktop and is immediately closed
var stubWin = window.open(‘about:blank’,’’,’ toolbars=0,width=100,height=100,top=10000,left=10000’);
stubWin.close();
return false;
}

//Entry point
OnCrmPageLoad();

1 comment:

Blogger said...

Are you trying to get cash from your websites by using popup ads?
In case you are, have you considered using Clickadu?