This idea comes to my head to create a simple search engine without any database and server side script. In this tutorial (well, I didn’t really mean tutorial, I just want to share my script) I tried to use only HTML5 and JavaScript to make this search engine.

The basic mechanism is, by using iframe and loop command, I tell the browser to collect all texts in paragraph elements on each html files I want. In this case, I have 4 html files. Each of them contains some text. The main script is in index.html file. When I type a word in search input box then click search button, the browser will load each one of these 4 html files and collect texts from it then store it in temp variable. This temporary variable will contain file address and file content. Then search script will look up on that temp variable to give the result. As the result, list of html files that contains searched word will appear as clickable link.

If you have any suggestion to improve this script, please leave your comment.

The main script is as below:

Habibie

Habibie is an Indonesian freelance PHP, MySQL, HTML5, CSS3, JavaScript, Java, Python and C# programmer. He also do graphics design, video editing, visual effects, animation, 3D modeling and making games.

Related Post

Pure HTML5 and JavaScript search engine
Tagged on: