Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Dojo Google Web Search 
 

In this section, you will learn how to implement the google web search. That means user enter your text that have to be searched.

 

Dojo Google Web Search

                         

In this section, you will learn how to implement the google web search. That means user enter your text that have to be searched. This program search all content related to its. If you click on the filtered data then you get the specific data.

Try Online: Google Web Search

 

 

 

 

Here is the code of program:

<html>
<head>
<title>Google Web Search Search Example</title>

  <style type="text/css">
    @import "../dijit/themes/soria/soria.css";
    @import "/resources/dojo.css";
  </style>

  <script type="text/javascript" src="dojo.js" djConfig="parseOnLoad: true"></script>

  <script type="text/javascript">
    dojo.require("dojox.data.GoogleSearchStore");
    dojo.require("dijit.form.Button");

    function doSearch() {
      var queryString = dojo.byId("searchText").value;
      var store = new dojox.data.GoogleWebSearchStore();
      var list = dojo.byId("searchOutput");

  //Clean up previous searches text
      while(list.firstChild){
        list.removeChild(list.firstChild);
      }
      
      store.fetch({query:{text: queryString},count: 25,onComplete: function(items, request) {
    //Print out the search results as an unordered list
      var delay = 0;
      dojo.forEach(items, function(item){
        var li = document.createElement("li");
        li.innerHTML = "<a href=\"" + store.getValue(item, "url")  "\">" 
store.getValue
(item, "title""</a>";
        dojo.style(li, "opacity""0");
        list.appendChild(li);

      //Fade in the results.
        delay += 500;
        dojo.fadeIn({node:li}).play(delay);          
      });
    }
  });
  }
</script>
</head>

<body class="soria">
<table border="1" cellpadding="0" cellspacing="0" width="600" align="center">
<tr>
<td valign="top" align="CENTER">
<b>Enter your search text:</b>
<input type="text" size="20" value="" id="searchText"/>
<div dojoType="dijit.form.Button" onclick="doSearch();">
  <b>Search</b>
</div>
</td>
</tr>
<tr>
<td valign="top">
<ul id="searchOutput" class="link-list"></ul>
</td>
</tr>
</tr>
</table>
</body>
</html>

Output:

When you run this program:

After entering your text. This program searches the related text from google:

-

 

Try Online:

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.