iframe id에이 코드를 적용했습니다.Mozilla에서 iframe의 키와 마우스 클릭을 비활성화하십시오.
<iframe id='<?php echo 'fraDisabled'.$i.$post->ID; ?>' src='<?php echo $file['url']; ?>' ></iframe >
function disableContextMenu()
{
var text="you dont have proper privelages to do this !!";
window.frames['<?php echo 'fraDisabled'.$i.$post->ID; ?>'].document.oncontextmenu = function(){alert(text); return false;};
window.frames['<?php echo 'fraDisabled'.$i.$post->ID; ?>'].document.onkeypress = function(){alert(text); return false;};
window.frames['<?php echo 'fraDisabled'.$i.$post->ID; ?>'].document.onmousedown = function(){alert(text); return false;};
}
PHP :
<iframe id='<?php echo 'fraDisabled'.$i.$post->ID; ?>' src='<?php echo $file['url']; ?>'>
</iframe>
그것은 크롬에서 작동하지만 모질라 파이어 폭스에서 작동하지 않습니다.
"Mozilla"는 Firefox를 의미합니다. – JJJ
@Juhana 네가 맞다 – zulfi
'''var text'에서''를 벗어나야한다. – user2428118