Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

JavaScript - Put FIND on your site - Code

Extracted from: Java Script Source Code 2002

How often we need to put a find function to the page but ignore it or don't even think about it becasue of its complications? Now we can get around that. Integrate the same "Find In Page" function offered by IE and Netscape browsers! Not the perfect method, but its all right!

Just copy-paste the following to your page. Read the same, before you do any copy-pasting.


<!-- TWO STEPS TO INSTALL FIND IN PAGE:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mike Hall (MHall75819@
aol.com) -->
<!-- Web Site: http://
members.aol.com/MHall75819 -->

<! >
<! >

<!-- Begin
var NS4 = (document.layers);
var IE4 = (document.all);

var win = this;
var n = 0;

function
findInPage(str) {
var txt, i, found;
if (
str == "")
return false;
if (NS4) {
if (!
win.find(str))
while(win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert(str + " was not found on this page.");
}
if (IE4) {
txt =
win.document.body.createTextRange();
for (
i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert(str + " was not found on this page.");
}
}
return false;
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<form name=search
onSubmit="return findInPage(this.string.value);">
Find in Page
<input name=string type=text size=15
onChange="n = 0;">
</form>



<!-- Script Size: 1.54 KB -->

You are done..

Do you know about computers?

Do you know about computers? Most would say YES, but if you have a good analysis, chances are, you only know one side of it - Software. You may be a genius in software and you may be able to do just about anything - troubleshooting to hacking!

But what if your computer has a hardware problem? Or your friend takes you to his home to fix a problem and you have to say "I don't know hardware" ?

This is a common problem for most of us. Some of you could even write a book about computer hardware, thanks to the countless theories you have studied at the college, but never touched a wire.

A good knowledge in hardware also helps a lot in programming. You can also save a lot in buying computers, if you have a good knowledge of the parts of the computer, what each part does and how they would perform together when integrated etc.

Experience in hardware is a must to succeed. Therefore, try to put your knowledge into practice. My advice for all of you is, start learning about hardware now it self, before its being too late. You live and sleep with the computer and you MUST know in and out of it.

There are enough free resources around to do just that. But if you are really curious and want to do the things quickly, consider http://owncomputer.vze.com

 

Want CASH? Have any idea of earning money? This is the easiest way of earning yet. No need to write websites, articles or nothing! Just give your opinion to companies and get paid. You can do it all-online, in your spare time. YES, your opinion worth it! Goto http://getpaidtosurveys.cjb.net. If you are a hard-liner, don't mind working hard and want to start an online career in earning money, goto http://123secrets.cjb.net.