Kênh Tên Miền chuyên cung cấp tên miền đẹp, giá rẻ! Hãy liên hệ kỹ thuật: 0914205579 - Kinh doanh: 0912191357 để được tư vấn, hướng dẫn miễn phí, Cảm ơn quý khách đã ủng hộ trong thời gian qua!
Sunday, December 5, 2010


Hôm nay chip lang thang trên mạng.Lại tìm được code bài viết liên quan.Chỉ bằng copy và paste là oke rùi: các bạn copy đoạn code sau.rùi tạo 1 HTML/JAVARSCRIPT và paste vào na.

<!-- Related Articles - Take 5 - Using JQuery &amp; Google Search API - by Hoctro 8/2010 -->
<script src="&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;" type="&quot;text/javascript&quot;"></script>
<script src="&quot;http://www.google.com/jsapi&quot;" type="&quot;text/javascript&quot;"></script>
<script language="&quot;Javascript&quot;" type="&quot;text/javascript&quot;">//<![CDATA[ //var website = &quot;hoctro.blogspot.com&quot;; var website = getBaseURL(); var hoctroRelated = &quot;site:&quot; + website + &quot; &quot;; var labelArray = new Array(); function getParams() { $(&#039;div.post-footer-line span.post-labels a&#039;).each(function(idx, el) { var test = 0; var textLabel = $(el).html(); for (var i = 0; i != labelArray.length; i++) { if (labelArray[i] == textLabel.toString()) test = 1; } if (test == 0) { labelArray.push(textLabel.toString()); hoctroRelated = hoctroRelated + &#039;&quot;&#039; + textLabel.toString() + &#039;&quot; OR &#039;; } }); // each } // Callback main function $(document).ready(function() { getParams() ; }); // function function OnLoadRelated() { // create a search control var searchControl = new google.search.SearchControl(); // create a draw options object so that we // can position the search form root var options = new google.search.DrawOptions(); options.setSearchFormRoot(document.getElementById(&quot;searchHoctroRelatedForm&quot;)); // populate with searcher var blogSearch = new google.search.WebSearch(); blogSearch.setUserDefinedLabel(&quot;Related Articles&quot;); var options2 = new google.search.SearcherOptions(); options2.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET); searchControl.addSearcher(blogSearch, options2); searchControl.draw(document.getElementById(&quot;searchHoctroRelatedResults&quot;), options); getParams(); searchControl.execute(hoctroRelated); } // Copied from http://www.gotknowhow.com/articles/how-to-get-the-base-url-with-javascript function getBaseURL() { var url = location.href; // entire url including querystring - also: window.location.href; var baseURL = url.substring(0, url.indexOf(&#039;/&#039;, 14)); if (baseURL.indexOf(&#039;http://localhost&#039;) != -1) { // Base Url for localhost var url = location.href; // window.location.href; var pathname = location.pathname; // window.location.pathname; var index1 = url.indexOf(pathname); var index2 = url.indexOf(&quot;/&quot;, index1 + 1); var baseLocalUrl = url.substr(0, index2); return baseLocalUrl + &quot;/&quot;; } else { // Root Url for domain name return baseURL + &quot;/&quot;; } } // Important, this has to be called here, otherwise main var is not yet created google.load(&#039;search&#039;, &#039;1.0&#039;); google.setOnLoadCallback(OnLoadRelated, true); //]]><br /></script>

<style><br /> //#searchHoctroRelatedResults a.gs-title, a.gs-title * { color : brown; }<br /> //#searchHoctroRelatedResults .gs-webResult .gs-snippet { display : none; }<br /> //#searchHoctroRelatedResults .gs-webResult .gs-visibleUrl { display : none; }<br /> //#searchHoctroRelatedForm { display : none; }<br /></style>

<div id="&quot;searchHoctroRelatedResults&quot;">Loading...</div>
<div id="&quot;searchHoctroRelatedForm&quot;">Loading...</div>
<h6>Related Articles Widget by <u><a href="http://chipkool.blogspot.com/">chipkool</a></u></h6>


CHÚC CÁC BẠN THÀNH CÔNG.

Theo Blog hoa học trò

0 comments:

Post a Comment

domain, domain name, premium domain name for sales

Popular Posts