Displaying first 30 comments.
| 1. Posted By: John - - December 3, 2007, 8:55 pm |
I love the script but I'm no fan of the floating DIV. I've been using a similar find-in-page script that has fewer features (no "Find Previous," for example) but works well in frames, which is what I use. The search text is entered in one frame, and the text to be searched lives in another frame.
Is there any chance that this script could be adapted for a frames environment?
|
| 2. Posted By: Jeff - - December 4, 2007, 10:38 am |
John,
I'm sure this script could be changed to use frames. You would just have to turn off the floating DIV functions and put it in a frames instead.
|
| 3. Posted By: John - - December 5, 2007, 9:56 am |
Hi Jeff,
Well, I gave it a try and I'm getting all sorts of errors. I think the problem is that the script doesn't know where to find the text to be searched (the other script that I mentioned required me to change a variable to include the frame name where the text to be searched was located). Is there something that you could add to the script so that a frame name could be added that would eliminate these errors? Thanks so much for whatever help you can offer.
|
| 4. Posted By: Will - - December 5, 2007, 2:25 pm |
Hi, great bit of javascript!
I like how the DIV opens at the top of the page but it would be so much better if it dropped down to stay in view when found text is lower down the page. (does that make sense?)
Basically when searching for text the page scrolls down to display the found text, at this point the DIV needs to be re-positioned automatically (to the top of what is now in view).
That way when what you can quickly search for another term without scrolling right back up to the top of the page, (lots of users will not know to press home pgup etc.
Let me know what you think.
Will.
|
| 5. Posted By: junji - - December 27, 2007, 1:15 pm |
you mean something like this:
greenhotels.com/members_beta1.html
just use arizona to see the CSS works
|
| 6. Posted By: Salvatore Bancheri - - January 5, 2008, 4:54 pm |
I like the find script but it does not work in my page. The pop-up window is to big... and it does not move when I scroll down the rest of the page.
Any idea what I need to do?
|
| 7. Posted By: Stewart O'Marah - - January 10, 2008, 9:37 am |
The Script works well enough until I put in a search keyword that is in my expandable horizontal javascript navigation menu, then it throws an 800a025e error and does not continue searching after that. Is there a way to omit the javascript from the search?
example of menu option that causes issue:
createMenu("Resources", "Resources");
addMenuItem("Resources", "HP Legal Web", "http://legalweb.corp.hp.com/legal/");
addMenuItem("Resources", "Ethics and Compliance Office", "http://ca.corp.hp.com/cser/obp/");
|
| 8. Posted By: Kika - - January 31, 2008, 11:26 am |
Hi All,
This script is great! Thanks a lot. I am currently using it and it is flicking in my browser...Anybody has the same issue? If so, How did fixed it?
Thanks,
Kika
|
| 9. Posted By: annie - - May 23, 2008, 1:49 am |
Hi Jeff,,the script is very good. But when you click the next or previous button without a text to search (this is only in firefox), the built in window.find appears. Then if you typed any text that is not in the content(in firefox only),it still displays TRUE instead of FALSE. Is it because of the built in window.find in firefox?How can this be fixed?anyway,,your script is very good!
|
| 10. Posted By: annie - - June 4, 2008, 9:35 pm |
hi jeff,,this is me again..I have a suggestion with the problem in firefox,where the built in find window appears everytime we press the next and previous button with the textbox empty.Why don't use the alert command to alert users to type a text to find first?This is only in firefox because in ie, the window works okay.
Can we call the javascript function(find window)without using the button?It appears onload?
Thank you very much for the prompt reply last may 24!
|
| 11. Posted By: annie - - June 5, 2008, 10:30 pm |
Hi Jeff, it still doesn't work in firefox. I've checked the 'new' code, but it wasn't changed. Anyway, I decided to use the alert command, and I've also found a way to display the box onload. Thanks for the information! The script is cool indeed!
|
| 12. Posted By: annie - - June 6, 2008, 10:59 pm |
Thanks Jeff! It worked...
|
| 13. Posted By: piznigley - - July 12, 2008, 1:48 am |
Thanks Jeff I used every "find on page" code there was until i stumbled on your script. excellant.
please email me on updates.
|
| 14. Posted By: Woolyss - - October 25, 2008, 11:13 am |
Thank you Jeff for your script. It's really interesting. I experimented it.
I've made another one. It use the famous searchhi. I modified it. Now, there is auto-scroll on the first word found.
Find on this page... NEW VERSION
|
| 15. Posted By: amul - - November 19, 2008, 5:59 am |
Thanks a lot for the script...
Its working fine...
|
| 16. Posted By: kostas - - January 1, 2009, 10:00 am |
hi I have noticed in firefox when using tables I have to click on the table to focus the search or else it wont find anything.
Also on firefox if I do not click the table to focus, I have to click find next (it does not find anything) and then when I click find prev, it finds the keyword without clicking on the table. a bit strange, so I used the build in function for the firefox.
But I like the div window so could you please fix this?
Thanks
|
| 17. Posted By: kanjo - - January 7, 2009, 10:37 am |
Has anyone modified this script to enable it to search for text in an embedded frame ?
|
| 18. Posted By: juan - jgstper@suddenlink.net - March 31, 2009, 7:56 am |
when i use the script the div flickers, similar to what kika was experiencing any one have the solution ?
|
| 19. Posted By: Jeff - - April 1, 2009, 12:02 am |
Do you have a link to your page? I can try to look at it and see what the problem is. The only time I had it flicker (that I can remember) is when I accidently put two "Find on this page" buttons on the page by adding the javascript statement twice. This shouldn't be done. The find.js file explains that if you want two find buttons on one page then you need to add it a different way.
Jeff
www.seabreezecomputers.com
|
| 20. Posted By: Rick - - April 2, 2009, 12:49 am |
Jeff,
I love the way that the script works on your site, but alas I am not very familiar with javascrpit. I would love to incorporate your script into my website www.trailershowroom.com ( more specifically on this page: http://www.trailershowroom.com/master_enclosed_options.htm )
I already have a page search function there, but it isn't very good. I have downloaded find.js but now I don't know what to do with it. Should I open it with wordpad and paste it's contents into the html of the specific webpage that I want to use it on? Should I upload the find.js file to my webserver? Could you please provide a little more detailed information as to how to incorporate your script into my webpage?
Thank you very much!
Rick
|
| 21. Posted By: Rick - - April 3, 2009, 10:59 pm |
Jeff,
Never mind..........Got it.
I have tested it in IE, Firefox, and Chrome. It seems to work well in all three.
Thanks,
Rick
|
| 22. Posted By: T - - May 8, 2009, 5:58 pm |
Can it find the string within iframe?
|
| 23. Posted By: Bomber - - July 2, 2009, 3:18 am |
Very Very useful thanks a lot !!! working perfect in each Browser..Exactly what I need !!!!
|
| 24. Posted By: andy - - September 2, 2009, 2:12 pm |
Hi. Has any one been able to make this script search a page automatically forward and back from a select list selection? I also need to have the find, search a page back and forth without a "find previous" button AND have the jump-to selection work.
Thanks for your help.
|
| 25. Posted By: Jeff - - September 8, 2009, 10:22 am |
Hi Andy. If you or anyone else needs the script to search again back at the beginning of the document then you can download it here: find_custom2.js
Jeff
www.seabreezecomputers.com/
|
| 26. Posted By: M - - September 23, 2009, 8:02 am |
Hi Jeff,
I would like to highlight all the occurence of the text at the same time. Do you have a suggestion ?
Thx
|
| 27. Posted By: Augusto - - October 14, 2009, 11:26 am |
Excelent work!
Thanks o Gracias! ;-)
|
| 28. Posted By: finduser - - December 20, 2009, 4:42 am |
you should not return in find previous when finds < 2!
Set finds to 2 instead.
if (finds < 2) finds = 2;
|
| 29. Posted By: finduser - - December 20, 2009, 4:47 am |
the complete modifications:
if (ie)
{
// if they found only 0 or 1 occurance then don't do anything
// because they haven't found enough to go backwards
if (finds < 2) finds = 2;
// Make finds variable go back to previous find
finds = finds - 2; // I don't know why I have to go back 2 : because you're doing a new find :-) which in fact is the equivalent to finds + 1
// move back to previously bookmarked position
try
{
txt.moveToBookmark(bookmark[finds]);
// select it
}
catch(e)
{
}
findit();
}
|
| 30. Posted By: finduser - - December 20, 2009, 4:59 am |
Another big problem:
If you have a lot of elements with display:none or hidden IE crashes when you try to select the found object. That's a known bug. To solve this problem you have to use a try catch... Moreover: finds++ should only be called when we really can select!!! Here is my solution for this problem:
if (txt.findText(string)) // if found
{
// select() not only highlights the string but
// it also moves the view to that location
// prevent ie bug if selection is not on display
try
{
txt.select();
test.innerHTML = document.selection.createRange().parentElement().outerHTML;
// scrollIntoView() is just a duplicate of what
// select does by jumping to the selection, so
// we don't realy need it.
txt.scrollIntoView();
// moveStart('character') moves the position in the
// text one character forward so that we can
|