HIDE THE SOURCE CODE IN TWO WAYS
Disabled Ctl + u and Right Click
For Right Click Disabled
<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "Sorry You can not see code";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>
For Ctl + u Disabled
<script>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) && isCtrl == true)
{
// alert(�Keyboard shortcuts are cool!�);
return false;
}
}
</script>
DISPLAY NONE(TR)
document.getElementById("id").style.display = 'table-row';
document.getElementById("id").style.display = 'none';
XLS FILE UPLOAD VALIDATION
<script language="javascript">
function Checkfiles()
{
var fup = document.getElementById('img_upload');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
if(document.getElementById('uploadname').value=='0.0')
{
alert('please select upload sheet name');
return false;
}
else if(ext == "xls" || ext == "xlsx")
{
return true;
}
else if(ext != "xls" || ext != "xlsx")
{
alert("Please select xls or xlsx file");
fup.focus();
return false;
}
}
</script>
CHECK ALL/UNCHECK ALL
<script LANGUAGE="JavaScript">
function checkAll() {
if (frmthis.CheckAll.checked==true)
for (i=0; i<document.frmthis.elements.length;i++)
{
document.frmthis.elements[i].checked=true
}
if (frmthis.CheckAll.checked==false)
for (i=0; i<document.frmthis.elements.length;i++)
{
document.frmthis.elements[i].checked=false
}
}
</script>
Disabled Ctl + u and Right Click
For Right Click Disabled
<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "Sorry You can not see code";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>
For Ctl + u Disabled
<script>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) && isCtrl == true)
{
// alert(�Keyboard shortcuts are cool!�);
return false;
}
}
</script>
DISPLAY NONE(TR)
document.getElementById("id").style.display = 'table-row';
document.getElementById("id").style.display = 'none';
XLS FILE UPLOAD VALIDATION
<script language="javascript">
function Checkfiles()
{
var fup = document.getElementById('img_upload');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
if(document.getElementById('uploadname').value=='0.0')
{
alert('please select upload sheet name');
return false;
}
else if(ext == "xls" || ext == "xlsx")
{
return true;
}
else if(ext != "xls" || ext != "xlsx")
{
alert("Please select xls or xlsx file");
fup.focus();
return false;
}
}
</script>
CHECK ALL/UNCHECK ALL
<script LANGUAGE="JavaScript">
function checkAll() {
if (frmthis.CheckAll.checked==true)
for (i=0; i<document.frmthis.elements.length;i++)
{
document.frmthis.elements[i].checked=true
}
if (frmthis.CheckAll.checked==false)
for (i=0; i<document.frmthis.elements.length;i++)
{
document.frmthis.elements[i].checked=false
}
}
</script>
<input id="CheckAll" onclick="checkAll(document.getElementById('chkid').value);" name="CheckAll" type="checkbox" />
How to create a Popup with CSS and Javascript
http://webdesignandsuch.com/how-to-create-a-popup-with-css-and-javascript/
RESIZE WINDOW WHEN LOAD WINDOW
<script language="JavaScript">
window.onload = Max_window;
function Max_window()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
RESIZE WINDOW WHEN LOAD WINDOW
<script language="JavaScript">
window.onload = Max_window;
function Max_window()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
No comments:
Post a Comment