Ex! Developer Network

我们知道普通方式 innerHTML 到容器中的脚本浏览器器是不会执行的,今天看 mootools 的时候发现靠它可以做到.

Ajax 类的说明:
Class: Ajax
    An Ajax class, For all your asynchronous needs.
    Inherits methods, properties, options and events from <xhr>.

Arguments:
    url - the url pointing to the server-side script.
    options - optional, an object containing options.

Options:
    data - you can write parameters here. Can be a querystring, an object or a Form element.
    update - $(element) to insert the response text of the XHR into, upon completion of the request.
    evalScripts - boolean; default is false. Execute scripts in the response text onComplete. When the response is javascript the whole response is evaluated.
    evalResponse - boolean; default is false. Force global evalulation of the whole response, no matter what content-type it is.
   
Events:
    onComplete - function to execute when the ajax request completes.</xhr>



Example:
>var myAjax = new Ajax('js.txt', {method: 'get', update: $$('body'), evalScripts: true}).request();
js.txt:
<script type="text/javascript"> alert('TEST'); </script>
代码片段 l 2008/05/07 15:11
特点: 跟随滚动条移动,点击 Menu 滚出,再点击 Menu 滚回去...

演示网站: http://www.seefta.com (我这边很慢, 页面载入完毕后会在左边显示 Menu 标签)

Ps: 最近在尝试用 Mootools 做各种特效. :D

Mootools 侧边导航菜单
作品展示 l 2008/04/10 22:22
输出 BBCode 的 TinyMCE. :)

支持各种文字修饰标签,超链接,图像,和 Flash。

在线演示:http://5jifen.com/photo/733

TINYMCE BBCODE VERSION
作品展示 l 2008/04/08 20:23
Project Babel 至 Discuz! 转换程序

可转换内容:

短消息
版块
文章
会员数据
Ing 数据

由于 Project Babel 密码加密方式不是采用标准的 MD5 加密,所以转换完成后所有会员必须使用找回密码功能重置密码。

Project Babel 至 Discuz! 转换程序
作品展示 l 2008/04/08 11:32
用户发布的图片

插件很多,连网站内部的搜索系统关键词都能统计,还能进/出站连接等,功能异常强大,强烈推荐. :D
代码片段 l 2008/03/30 21:05
TAG Mint
演示网站: http://www.maoshu.net

登录没什么好说的,就是要解决跨域 Cookie 设置的问题。

Dede 用户系统的积分采用定时缓存的方法同步 Discuz 的积分,这是比较方便的方式(客户要求尽量少改 Discuz,Dede 用不爽就删...),下面的操作会触发积分同步操作:用户登录,在线超过 5 分钟,在 Dede 上积分被增加或减少(会将新的积分值写入 Discuz 数据库)。

由于网站与论坛位于不同域名下,所以积分同步采用了类似支付宝 API 的 HTTP 文件访问的方式同步。

Dede 5 原来自带的 API 由于里面 SQL 语句错误是无法使用的 (作者发布前都不测试下 -_-|||).
作品展示 l 2008/03/27 22:49
1 

日志分类

所有分类 (6)
作品展示 (4)
代码片段 (2)

日历

«   2008/05   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
tistory!get rsslazylogs Tistory Tistory 가입하기!