Linux中国  设为主页
 收藏本站
 
当前位置: > 首页 ->网站设计 ->AJAX教程 ->prototype.js 1.4 原代码阅读
  相关分类: 
AJAX教程
CSS/CSS2
Dreamweaver
Fireworks
Flash
HTML/DHTML
JavaScript
Phososhop
网页制作
  站内搜索: 
热门文章排行
热门文章排行 Ajax实现分页查询(06-04)
prototype.js 1.4 原代码阅读(04-24)
使用AjaxPro开发四级无刷新联动下拉(06-04)
在Struts应用中使用Ajax(04-24)
Ajax:拥抱JSON,让XML走开(04-24)
精采文章排行
精采文章排行 使用AjaxPro开发四级无刷新联动下拉(06-04)
微软Asp.net Ajax 1.0的AutoComplete(06-04)
Ajax实现分页查询(06-04)
Ajax实现不刷屏的前提下实现页面定时(06-04)
Ajax程序设计入门(06-04)
  ·微软Asp.net Ajax 1.0的AutoComplete控件·Ajax实现分页查询·Ajax实现不刷屏的前提下实现页面定时刷新·Ajax程序设计入门·微软的Ajax库客户端Bug总结·利用AJAX和ASP.NET实现简单聊天室 ·利用AJAX技术实现网页无刷新进度条显示·Ajax联动下拉框的实现例子·AJAX如何与后台交互

prototype.js 1.4 原代码阅读

作者:Webmaster   来源:Linux-cn.com   点击:   日期:2007-04-24 [收藏] [投稿]

  IE是否经常中毒?推荐您


        var splitValueBy = function(delimiter) {
          return value + ' && ' + value + '.split(' + delimiter.inspect() + ')';
        }

        switch (attribute.operator) {
          case '=':       conditions.push(value + ' == ' + attribute.value.inspect()); break;
          case '~=':      conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break;
          case '|=':      conditions.push(
                            splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
                          ); break;
          case '!=':      conditions.push(value + ' != ' + attribute.value.inspect()); break;
          case '':
          case undefined: conditions.push(value + ' != null'); break;
          default:        throw 'Unknown operator ' + attribute.operator + ' in selector';
        }
      });
    }

    return conditions.join(' && ');
  },

  compileMatcher: function() {
    this.match = new Function('element', 'if (!element.tagName) return false; \
      return ' + this.buildMatchExpression());
  },

  findElements: function(scope) {
    var element;

    if (element = $(this.params.id))
      if (this.match(element))
        if (!scope || Element.childOf(element, scope))
          return [element];

    scope = (scope || document).getElementsByTagName(this.params.tagName || '*');

    var results = [];
    for (var i = 0; i < scope.length; i++)
      if (this.match(element = scope[i]))
        results.push(Element.extend(element));

    return results;
  },

  toString: function() {
    return this.expression;
  }
}

function $$() {
  return $A(arguments).map(function(expression) {
    return expression.strip().split(/\s+/).inject([null], function(results, expr) {



 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<

上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1920 21 22 23 24 25 26 27 28 29 30 31 下一页

上一篇:prototype.js1.4 版开发者手册   下一篇:prototype.js常用函数及其用法
文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论

   相关文章:
·使用AjaxPro开发四级无刷新联动下拉框

   文章评论:(1条)
  
 请留名: 匿名评论   点击查看所有评论 论坛讨论
 

 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。