2006年01月06日

原理:
在页面动态植入一个DIV,然后用javascript将博客文章分类当航数据提取出来,并重新排序,设置导航的样式,具体效果看本BLOG的导航效果.原理可以用在一些其他的应用上
文章分类数据的提取是JS利用H3和UL的在页面的标签位置获得,不同BLOGGER可能加的东西不一样,位置也不一样,需要找到相应的位置,,既代码中的数字[3],[1]
CSS代码,定义这个导航DIV的样式,,导航的放置位置,,也可调节相应的数值来控制:

从介绍看,还是很有吸引力去了解一下这个JAHAH,http://www.blogmatrix.com/tls/jahah/

What is JAHAH?

JAHAH is an AJAX-like technology for ‘mashing’ web pages together.

  • It is easy for web page authors to include JAHAH documents
  • It is easy for content producers to create JAHAH documents
  • JAHAH documents can be included "cross-domain", unlike most AJAX technologies
  • JAHAH documents are search engine friendly

Where does JAHAH come from?

JAHAH is based on existing ideas and technology:

  • AHAH is technology for directly including HTML fragments using AJAX
  • JSON is a scripting-language friendly way of transmitting
    data across the web (that works cross-domain)
  • JSONP is an incremental improvement to JSON that allows
    the document requestor to specify an arbitrary prefix to be returned
    prepended to the result

JAHAH Web Service Description

A web service that provides JAHAH documents must behave as following:

  • If there is a ‘jsonp’ parameter, it must return:

    • the value of that parameter, followed by
    • if everything’s OK: a JSON dictionary with ‘html’ containing the payload
    • if there’s a problem: a JSON dictionary with ‘error’ containing the error message
  • If there is no ‘jsonp’ parameter, or it is empty, the webservice must
    return an HTML document, where the BODY of the document is the payload

It is also acceptable, though not encouraged, to return only a string with the payload rather than
a dictionary. It is OK to return other values with the dictionary, excepting that
all single letter keys are reserved
.

How do I include JAHAH in my document?

You are free to do this anyway you like if you don’t care for what we’ve done here.
However, we do provide some pretty nifty tools if you want to try them. Note that
do not add the ‘jsonp’ parameter to URIs here — our code provides this function
automatically to callback to the correct places.

NOTE: our JAHAH tools use MochiKit. We include a copy
in our little source distribution for now, but we may take it out
if this thing starts rolling.