
Disclaimer
This source code is
written and maintained by an individual, not a company. It has been provided for
free to the Microsoft .NET user community with the expectation that users will
take whatever action necessary to get the code to operate according to their
needs. This includes debugging and enhancements. The source code is provided "as
is" and there are neither warrantees to the quality of the work nor any
expressed or implied agreements that the programmer will release any updates.
The programmer will release updates and provide any support at his own
discretion.
Introduction
The
Article is mainly for Beginners of JavaScript writers. In this article I have
shown how to display a text message in the status bar and I also given the code
for right click protected Screen. Actually it is a simple and a easy one. The
developers can easily use this code in the application, which they develop. What
you have to do is just copy paste in the your application.
How it
works
It will keep on running in the status bar of the browser window in which page
the script is added.

The
Following is the code for displaying running text in the status
bar.
<script language="JavaScript">
<!--function scrollit_r2l(seed) {
var m0 = " Vivek's JS sample Gallery";
var m1 = " - JavaScript A best scripting language i ever seen";
var m2 = " - , Hello!!! ";
var m3 = " - , Human Intelligence";
var msg=m0 + m1 + m2 + m3;
var out= " "; var c = 1;
if (seed > 99) {
seed--;
var cmd="scrollit_r2l(" + seed + ")";
timerTwo=window.setTimeout(cmd,99);
}
else if (seed <= 99 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,99);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,99);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit_r2l(100)",75);
}
}
}
timeONE=window.setTimeout('scrollit_r2l(100)',500); </script>
And
I hope you all enjoy the above code.
The next code is for right
click protected screen.
<script language="JavaScript">
message = "Sample JS free to study + Help + More^" +
"^"
scrollSpeed = 25 lineDelay = 1500
txt = ""
function scrollText(pos) {
if (message.charAt(pos) != '^') {
txt = txt + message.charAt(pos)
status = txt
SP = scrollSpeed
}
else {
SP = lineDelay
txt = ""
if (pos == message.length-1) pos = -1
}
pos++
setTimeout("scrollText('"+pos+"')",SP)
}
scrollText(0)
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2)) return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("This is 'Right Click' Protected Screen"); return false;
}
return true;
}
document.onmousedown=right;
</script>
How to Include in Your web
page
Include the .js file into your script:
<script
language="javascript" type="text/javascript" src="filename.js"></script>
Or
just copy all the lines of above code and paste in the html
area
<html>
<title>
<script language="javascript"></script>
</title>
</html>
And
I hope you all enjoy the above code also.
For more help and queries
please mail me vivekthangaswamy@gmail.com