Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: FindInPage()

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FindInPage()

    Hi. A while ago I expanded on Mike Hall's FindInPage() script. Essenially, my code allows the user to perform a JavaScript driven search of my web site. Since then I've tried to improve it.

    One of the things that bother me is how web pages have to be loaded onto my main frame, then searched. Causes a lot of flashing pages. I was thinking of first loading pages into a hidden frame. IE tests look good, but NS4 has been crashing with "page overflows". Have no idea why. I've been thinking of alternatives.

    Question. Is it possible to load a txt or html in something other than a frame? Into an object you can still find() or findtext()?

    Question. Is it possible to load a txt or html file into a frame without images, just text?

    Question. Is it possible to first hide my main frame, then load it with page or pages? Only after I've done searching would I make it visible again. It is possible?

    Any feedback is appreciated...Dennis

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    I use the same script on my site by allowing a search for a word in any page loaded into my main frame.

    If I understand your request, you want to search all pages on your site and only load the pages that contain the word searched for?

    This, I think, is not going to be possible with the FindInPage script unless some MAJOR surgery is done to the script.... like totally re-writing it.

    I also have a site search facility and compared to the FindInPage script the site search script is a lot, lot more complex because of the data base it has to check through.

    Still, you never know, you might do it.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply, finally.

    I already wrote a FindInWeb() that works with an adjusted FindInPage(), see www.dennisallen.com.

    Now I want to improve it. I want to perform the initial search in a hidden frame. Only if found, load the page on the main frame. I was having a bad time with NS4 crashing with 'stack overflow'. Turns out, NS4 crashes only if a web page containing <p align='justify'> loads in a hidden frame. Took me all weekend to figure that out.

    The other thing I want to improve is my buttons. Right now I have [Find] to search the current file and [Locate] to search the next file. I'd like to have just one [Go] button. Problem(s). A person could [Go] from text found to text found until end of file. Then I could prompt whether to search the next file or continue at the top of page. But suppose there are thousands of hits on one page? A [Locate] would take you to the next page. I wish you could move the mouse cursor, then search from that point on.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •