- 浏览: 390239 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
expando is something like this
elem.attr, or you can use something like this: elem[attr];
while attribute is something like this:
elem.getAttribute("attr_name");
there are something about expando that you should know.
- First, the naming of expandos are generally more consistent across browsers.
- Second, expandos have some name limitations as to what names they are capable of using.
- Third, expando properties don't exist on XML nodes.Expando properties are primarily only available on HTML documents
- Fourth, it should be noted that not all attributes become an expando, custom ones does not become expando, you may do some test before access the custom expando, and fall back to attributes way if necessary
- Last, and perhaps most importantly, expandos are much, much, faster than their corresponding DOM attribute operations (especially so in Internet Explorer).
below shows the code access the attriute of some elements, while in prefer to expandos.
/************************************** *@Name: expandoattr.js *@Summary * this shows the example of how you make use of the expando and others.. * * ***************************************/ (function () { // map expando names, the primarily reason for why the expando name mapping is because some are reserved world. and some are key words var map = { "for": "htmlFor", "class": "className", readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", colspan: "colSpan", tabindex: "tabIndex" }; this.attr = function (elem, name, value) { var expando = map[name] || name, expandoExists = typeof elem[expando] !== "undefined"; if (typeof value != "undefined") { // this attribute tells where or not you can use the expando attributes if (expandoExists) { elem[expando] = value; } else { elem.setAttribute(name, value); } return expandoExists ? elem[expando] : elem.getAttribute(name); } }; })();
发表评论
-
javascript - trick to cross browser DOM ready event
2012-08-24 08:23 903the "ready" event ... -
javascript - trick to simulate mouseenter and mouseleave
2012-08-23 08:31 2229Previously we discussed javasc ... -
javascript - trick to simulate the change event
2012-08-22 08:51 1616In the previous discussion a ... -
javascript - trick to simulate bubbling submit event
2012-08-22 08:03 885In the previous discussion abou ... -
javascript - trick to implement bubbling submit event
2012-08-23 07:55 674Following up to the javascrip ... -
javascript - trick to detect bubbling supportability
2012-08-20 22:22 934Event delegation is oe of the b ... -
javascript - trigger event and custom events
2012-08-20 21:58 2047In the previous post - javascri ... -
javascript - trick to handlers management
2012-08-20 08:19 996We have discussed "javascr ... -
javascript - trick to centralized store
2012-08-20 07:52 787For a number of reasons it's ... -
javascript - trick to fix the event object
2012-08-20 07:47 850Many browsers, especially In ... -
javascript - tricks to deal with colors
2012-08-15 08:34 745There are a couple of ways to r ... -
javascript - trick to manipulate the opacity
2012-08-15 08:26 745All other browsre may have supp ... -
javascript - trick to test visibility of an element
2012-08-15 08:15 499though there is a visible prope ... -
javascript - trick to get and set height and width
2012-08-15 08:05 525when looking at properties t ... -
javascript - trick to set/get attributes that expects px values
2012-08-16 11:00 497When setting a number into a ... -
javascript - trick to get and set CSS style
2012-08-16 11:00 719while it will not be so much tr ... -
javascript - trick to normalize href for IE
2012-08-16 10:59 509IE is again the only browser th ... -
javascript - trick IE form and its expando attribute
2012-08-16 10:59 1012there is a known issue that if ... -
javascript - trick to getText and setText
2012-08-14 07:40 1108it is not as simple as you thin ... -
javascript - trick/guideline to remove DOM element
2012-08-14 07:00 1160remove an element is not as sim ...
相关推荐
本文给大家总结了12个javascript常用的基本功能,十分的实用,这里推荐给大家,需要的朋友可以参考下
HTML中不支持静态Expando的元素的问题
jquery.expando 一个jQuery插件,用于制作随您而生的文本 要查看此插件的运行情况,请查看 。 用法 选项1:适用于IE 9,Chrome,Firefox,Safari。 <!doctype html> <html> <head> <title>...
有关详细信息,请访问网站: :
一、实现原理: ...对于Javascript对象,数据则直接存储在该Javascript对象的属性jQuery.expando上。在读取、设置、移除数据时,实际上是对Javascript对象的数据缓存对象执行读取、设置、移除操作。 为了避免jQu
规则扩展 描述 选择ExpandoColumn和规则的可能值
这是一个教育应用程序的自举示例,该应用程序允许用户注册教授竞争性辩论原理的课程。
jqueryData jquery.data.2.0.3.js jQuery 2.0.3版具有1.8.0版中的扩展功能。 例子用于查找元素的功能事件。 $(element).data('events') $._data('element', 'events')
jQuery 3.0 在6月9日正式发布了,3.0 也被称为...Data 有 1 个对象属性(expando)和类属性(uid),有 6 个方法,如下 下面分别解读 1、Data.uid 这是一个从 1 开始用来自增的数字。 2、expando 由 jQuery.expando 和 uid
为了能够通过 DOM 对象找到这个扩展数据对象,而不会与其他现有的属性冲突,在 jQuery 中通过 expando 这个常量表示扩展对象的属性名,这个 expando 的值是计算出来的。而这个属性的值就是用来找到扩展对象的键值。 ...
//expando 用于决定当前页面的唯一性。 /\D/ 非数字。其实就是去掉小数点。 expando: jQuery + ( version + Math.random() ).replace( /\D/g, ), // Assume jQuery is ready without the ready module isReady: ...
Js实现鼠标悬停放大图片,当鼠标放在图片上的时候,图片慢慢的放大显示,鼠标移走后,图片恢复至缩略图模式,使用了expando.js JS封装类。
2)git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScriptBundle.tmbundle该捆绑包包括语法高亮显示,编译或评估内联CoffeeScript的功能,方便的函数符号列表以及许多expando代码段。...
2.2.6 expando动态对象 2.2.7 范围(range) 2.3 groovy的高级特性 2.3.1 一切都是对象 2.3.2 元编程(metaprogramming) 2.3.3 生成器(builder) 2.4 本章小结 第3章 grails...
expando 属性 避免切换类和样式规则 查找父项之前,先折叠文本范围 其他资料 简介 动态 HTML (DHTML) 在 Microsoft:registered: Internet Explorer 4.0 中的引入,使 Web 作者和开发人员可以使用新的编程...
首先她会判断目标是否是元素或者对象,如果是元素,则在元素上打一个标识( expando )然后值是生成的一个 guid ,并在缓存对象下建立一个缓存,比如: $.cache={ '2': { data: {}, events: {}, handle: function(){} ...
用于ASP.NET Core 5.0的伪身份验证Jwt承载此代码允许伪造Jwt Bearer并为ASP.Net Core应用程序构建集成测试。 通过这种方式,我们可以伪造所需的任何... 我定义了两种测试方法: 通过Expando对象验证令牌的代码如果未设
支持动态 Expando(读)和匿名类型(写) 任何类型的自定义格式和解析 支持多态类型的序列化 用于将对象克隆和重新解析为不同类型的实用程序 额外的IDictionary扩展简化了弱类型 JSON 数据的处理。 直接从 ...
它是一个基于Expando或dynamic类型的小型 MicroORM,让您几乎可以毫不费力地使用您的数据库。 该设计基于这样一个想法,即在此存储库中提供给您的代码是一个开始:您可以立即启动并运行,然后根据需要对其进行编辑和...