dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Search feature in an HTML page

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Search feature in an HTML page

    I have some HTML files in my Server, and a master HTML file containing Search Textbox and Submit button. User will be entering a keyword in that Textbox, if the word exists, it must show that word highlighted and the URL where it is present. Else display word not found. Can this be done in Ajax/ JS/ DOM ? Please help me.

    Thanks in advance...

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,277
    A simple way consists to build a javascript with the lists of keyword of each HTML page. Some objects with the keywords, urls and pages's themes could then facilitate the research...

    The Meta tags could be useful...

    This page Importing the site navigation can provide ideas for structuring pages and using AJAX to import elements.


    Since, to make this search on the fly, a server language (PHP, ASP...) is necessary.
    Last edited by 007Julien; 03-26-2013 at 07:19 AM.

  3. #3
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    you can load all the files into javascript using ajax and search them locally.
    this defeats one advantage of having the search done by a server: saving the serving of un-needed files.
    however, it does allow the main functionality: finding the content the user wants.

    another plus on doing it client-side is that it is much faster to execute, allowing results to be shown as you type, and unlike a server, it can work without an internet connection.

    it really depends on how much "stuff" you got to search. if you can send it in a dozen request totalling a couple hundred KB, i'd say go for it.
    if it's going to take 5323 files weighing 50MB, you need to use a server.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles