支持 onchange 事件的 Select 模拟

Posted in Web Development // Posted at 2009/08/05 13:42
从一个韩国网站弄下来的,不过人家用的是 div, 兼容性不好,我改成了 input.

演示: http://web.mac.com/explon/Select/ (使用方式见源码)

2009/08/05 13:42 2009/08/05 13:42

submit

2009/04/28 15:03 2009/04/28 15:03

submit

Ext Core: 一个新的 JavaScript 框架

Posted in Web Development // Posted at 2009/04/10 09:34

Ext Core is a cross-browser JavaScript library for building dynamic web pages. It includes:

  • High performance, lightweight
  • Clear, maintainable code
  • An intuitive, easy to use API
  • MIT Open Source licensed

Ext Core supports all major web browsers including:

  • Internet Explorer 6+
  • FireFox 1.5+ (PC, Mac)
  • Safari 3+
  • Opera 9+ (PC, Mac)

2009/04/10 09:34 2009/04/10 09:34

submit

可以在所有浏览器弹出窗口的 JS

Posted in Web Development // Posted at 2008/10/31 22:42
背弹式,24 小时一次,被浏览器拦截后跟随网页的 onclick 事件触发。


2008/10/31 22:42 2008/10/31 22:42

submit

让 innerHTML 中的脚本跑起来

Posted in Web Development // Posted at 2008/05/07 15:11
我们知道普通方式 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>

2008/05/07 15:11 2008/05/07 15:11

submit