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

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Dojo Google Blog Search 
 

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

 

Dojo Google Blog Search

                         

In this section, you will learn how to implement the google blog search. That means user enter your text that have to be searched. This program search all content related to blog in the site. If you click on the filtered data then you go the specific blog site. And do your word.

Try Online: Google Blog Search

 

 

 

 

Here is the code of program:

<html>
<head>
<title>Dojo Google Blog Search Store 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.GoogleBlogSearchStore();
    var list = dojo.byId("searchOutput");
    dojo.byId("content").innerHTML = "";
    
    //Clean up previous searches
    while(list.firstChild){
      list.removeChild(list.firstChild);
    }
    
    store.fetch({
      query:{text: queryString},
    count: 8,
      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, "postUrl")  
        "\">" +
        store.getValue(item, "titleNoFormatting"+
        "</a>";
        dojo.style(li, "opacity""0");
        list.appendChild(li);
      dojo.connect(li.firstChild,"onclick", function(evt){
      var frame = dojo.byId("content");
      dojo.style(frame, "display""block");
      frame.src = store.getValue(item, "postUrl");
      dojo.stopEvent(evt);
      return false;
      })
        
        //Fade in the results.
        delay += 500;
        dojo.fadeIn({node:li}).play(delay);          
      });
      }
    });
    }
  </script>
</head>
<body class="soria">
  <b>Please Enter your text for searching: </b>
  <input type="text" size="20" value="" id="searchText"/>
  <div dojoType="dijit.form.Button" onclick="doSearch();">
    <b>Search</b>
  </div>

  <div>
    <ul id="searchOutput" class="link-list"></ul>
  </div>
  <iframe id="content" 
    style="display:solid;width:100%;height:400px;"></iframe>
   </body>
 </html>

Output:

When you run this program then you get:

Enter your search text then you get the related text as follow:

 

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.