There is two frame in my form.In d first frame there is a text box,and i give some word in the text box.I want to search the word from a file from the location( http://45.12.09.31...........) and if the word is found any file of that location,
the file will display in second frame.
main problem is arise in the following line.
txt = s.document.body .createTextRang e();
here the code is : -
<html>
-
-
<head>
-
<meta http-equiv="Content-Language" content="en-us">
-
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
-
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
-
<meta name="ProgId" content="FrontPage.Editor.Document">
-
<title>New Page 1</title>
-
</head>
-
-
<body>
-
-
<p align="center"> </p>
-
-
<p align="center"> </p>
-
-
<p align="center"><b><u><span style="background-color: #FFFFFF"><font face="Copperplate Gothic Bold" size="6" color="#000080">Find
-
The Page</font></span></u></b></p>
-
<p align="center"> </p>
-
<p align="center"> </p>
-
<p align="center"> </p>
-
-
<p align="center">
-
-
</p>
-
-
<Script language = JavaScript>
-
var year = new Array("2007");//,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
-
var month = new Array("May");//,"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
-
-
-
var i = 0;
-
var i1 = 0;
-
var IE4 = (document.all);
-
var n = 0;
-
-
function findInPage1(str)
-
{
-
var i2,txt,found;
-
-
for(i=0;i<year.length;i++)
-
{
-
for(i1=0;i1<month.length;i1++)
-
{
-
s="http://10.50.110.59:1977/archive/sysdoc1_";
-
s+=month[i1];
-
s+=year[i];
-
s+=".htm";
-
//parent.word_f2.location.href=s;
-
-
-
if (str == "")
-
return false;
-
-
if (IE4)
-
{
-
//txt = window.document.body.createTextRange();
-
//txt = parent.word_f2.document.body.createTextRange();
-
txt = s.document.body.createTextRange();
-
-
-
// Find the nth match from the top of the page.
-
-
for (i2 = 0; i2 <= n && (found = txt.findText(str)) != false; i2++) {
-
txt.moveStart("character", 1);
-
txt.moveEnd("textedit");
-
}
-
-
if (found) {
-
// document.write(s);
-
parent.word_f2.location.href=s;
-
txt.moveStart("character", -1);
-
txt.findText(str);
-
txt.select();
-
txt.scrollIntoView();
-
n++;
-
}
-
-
else {
-
if (n > 0)
-
{
-
//document.write(qqq);
-
-
n = 0;
-
findInPage1(str);
-
}
-
-
// Not found anywhere, give message.
-
-
else
-
//{
-
//document.write(wewe);
-
-
alert("Not found.");
-
// }
-
}
-
}
-
return false;
-
-
-
}//for loop1
-
}//for loop2
-
}
-
-
-
</script>
-
-
<form name="search" onSubmit="return findInPage1(this.string.value);">
-
<p align="center">
-
<font size=3 face="t"><b><input name="string" size=15 onChange="n = 0;"></b></font>
-
<span style="background-color: #00FFFF">
-
<input type="submit" value="Search" style="font-size: 12pt; font-family: Times New Roman; font-weight: bold; color: #0000FF"></span></form>
-
-
-
</body>
-
-
</html>
-
Plz help.thanking you.
1 4636 acoder 16,027
Recognized Expert Moderator MVP
Check out this link and see if it helps solve your problem.
PS. I've changed the thread title.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: JF Potvin |
last post by:
Hi ! I'm new to Perl and this group so any help is welcome. I've
look around the groups a lot but I can't seems to find what I need.
I have to do a script that connects to a specific web page and search
it's source code for some words. Now, the script is able to connect
to the page, print the source on screen but when I try to search, it...
|
by: Les Juby |
last post by:
A year or two back I needed a search script to scan thru HTML files
on a client site. Usual sorta thing. A quick search turned up a
neat script that provided great search results. It was fast,
returned the hyperlinked page title, filename, and the body txt (30
preceding and following words) in context with the search word
highlighted. ...
|
by: Rob Meade |
last post by:
Lo all,
Ok - just spotted another problem I'm going to have.
All of the rows for the page content in the database contain formatting ie,
<b>some bold text</b>
This will cause me a problem initially as if I wanted to search for <company
name> the SQL statement
|
by: Deryck |
last post by:
Hi,
I am working on an e-commerce site. It uses a CMS. One requirement is to
have a static off-line version so that the company's sales reps can visit
customers and take orders on a laptop without having to go online (I'm told
that the rep's customers don't always appreciate being asked for a phone
line to be tied up and that sometimes they...
|
by: Russell |
last post by:
Hey,
ok i have numerous tables to search through for a 'site search'.
some of the searchble fields have html embeded within so after some quick
referencing, saw I can use the regExp function to strip out all the HTML
leaving only the raw text.
(done and works a treat)
My issue is:
| |
by: vonclausowitz |
last post by:
Repost from an VB group.
Hi All,
I'm looking for a way to search for multiple words in a database.
There is however one but. The words have to be within a certain range
of each other.
For example I would like to find records which contain the word MALE
and within for example 10 words of it the word BROWN.
|
by: kirpi |
last post by:
In order to instant retrieve a word definition, I let a javascript add
the word to the search url of various sites. Example: for the word
"word" I create:
- http://en.wikipedia.org/wiki/Word
- http://www.google.it/search?q=define%3Aword
- http://www.answers.com/word
and so on.
There is a good German online dictionary, www.pons.de/, for...
|
by: |
last post by:
I have a question about spawning and displaying subordinate list controls
within a list control. I'm also interested in feedback about the design of
my search application. Lots of code is at the end of this message, but I
will start with an overview of the problem.
I've made a content management solution for my work with a decently...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |