JS超精简实现链表!(转)
摘要:单向链表 百度百科:http://baike.baidu.com/view/549479.htm?fr=ala0_1最近家里来了个高手,他是学JAVA的。正在努力跟他学习!如果有对链表的误读,还请高手指点..小弟感激不尽。JS实现 链表!直接上代码。[代码]你敢相信吗?上面的代码实现了。一个单向链表!用下面的代码,就可以使用这个单项链表.[代码]当然链表不能仅仅只有 一个add方法。于是我添加了 ...
阅读全文
posted @
2010-08-01 17:24
一粒沙
阅读(431)
推荐(1)
jquery hashtable
摘要:jQuery.Hashtable = function() { 02this.items = new Array(); 03this.itemsCount = 0; 04this.add = function(key, value) { 05if (!this.containsKey(key)) { 06this.items[key] = value; 07this.itemsCount++; 0...
阅读全文
posted @
2010-08-01 17:23
一粒沙
阅读(2506)
推荐(0)
Extjs--布局常识
摘要:/*//Viewportfunction(){var vport=new Ext.Viewport({enableTabScroll:false,layout:"fit",//borderitems:[{title:"面板",html:"esfsdf", tbar:[{text:"按钮1"},{text:"按钮2"}], bbar:[{text:"按钮1"},{text:"按钮2"}]} ]});...
阅读全文
posted @
2010-07-27 17:03
一粒沙
阅读(539)
推荐(0)
js创建xml document对象
摘要:前几天用jQuery解析XML内容,发现直接将字符串放到$()中会引起问题,而先用上面的这段代码将字符串可靠的转成一个document对象再交给jQuery可以产生正确的jquery对象。function create_doc(text){ var xmlDoc = null; try //Internet Explorer { xmlDoc=new ActiveXObject("Microso...
阅读全文
posted @
2010-07-26 15:58
一粒沙
阅读(6783)
推荐(0)
extjs 模拟按钮点击
摘要:使用fireEvent方法:btn.fireEvent('click');
阅读全文
posted @
2010-07-23 18:02
一粒沙
阅读(1076)
推荐(1)
ExtJs viewport & 可复用框架
摘要:在项目里面使用ExtJs viewport定义页面框架时,各页面的框架基本相同,只有对各页面内部会有少许不同。 此文介绍我在使用ExtJs的viewport时,采用的方法。 步骤一:在公共文件ExtCustomer.js中定义区域对象[代码] 上面代码中定义了四个区域:页头,页脚,左侧和内容。步骤二:在各页面的处理函数中,使用定义的区域对象[代码] 单个页面代码如上。其中给左侧区域添加标题和区域收...
阅读全文
posted @
2010-07-23 18:01
一粒沙
阅读(1124)
推荐(1)
动态添加一个控件到viewport中去
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--Ext.namespace('IAMadmin');IAMadmin.MainApp=function(){//publicspacereturn{//publicpropertiesviewport...
阅读全文
posted @
2010-07-23 17:37
一粒沙
阅读(1483)
推荐(0)
extjs menu几个有用的属性
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--arrayMenu.push({text:colorText,menuSource:arrayMenuSource[i],enableToggle:true,//是否允许交替按钮状态//pressed...
阅读全文
posted @
2010-07-08 16:45
一粒沙
阅读(955)
推荐(0)
选择器中and和or的关系
摘要:$(":not([title='test']):not([id='mover'],[id='one'])").css("background", "#bbffaa");and关系:多个选择器合并在一起,连起来写,如::not([title='test']):not([id='mover']or关系:多个选择器之间使用逗号“,” 分隔,如:not([id='mover'],[...
阅读全文
posted @
2010-07-07 19:38
一粒沙
阅读(676)
推荐(0)
X2JSCompactor JS打包工具
摘要:挺好用的工具1.使用一个项目文件来管理要打包的js文件,不用每次都重新弄一次2.打包的js文件先后顺序可以调整3. 目前没有加密,只是去掉了注释与换行下载
阅读全文
posted @
2010-07-06 16:40
一粒沙
阅读(392)
推荐(0)
ExtJs之Ext.data.Store
摘要:Store.getCount()返回的是store中的所有数据记录,然后使用for循环遍历整个store,从而得到每条记录。除了使用getCount()的方法外,还可以使用each()函数,如下面的代码所示。store.each(function(record){ alert(record.get('name')); });store.each(function(record) { alert(r...
阅读全文
posted @
2010-06-22 10:10
一粒沙
阅读(513)
推荐(0)
JQuery对象综合解析xml
摘要:方法1:Html文件 代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-...
阅读全文
posted @
2010-06-18 16:00
一粒沙
阅读(1713)
推荐(0)
初学jquery之自学笔记(5)
摘要:111.用匹配的元素替换掉所有 selector匹配到的元素。$("<b>Paragraph. </b>").replaceAll("p"); 112.将所有匹配的元素替换成指定的HTML或DOM元素。$("p").replaceWith("<b>Paragraph. </b>"); 113.删除匹配的元素集合中所有的子节点。$("p").empty...
阅读全文
posted @
2010-06-18 15:34
一粒沙
阅读(209)
推荐(0)
初学jquery之自学笔记(4)
摘要:86.把与表达式匹配的元素添加到jQuery对象中。这个函数可以用于连接分别与两个表达式匹配的元素结果集。$("p").add("span');$("p").add("<span>Ajax</span>");87.取得一个包含匹配的元素集合中每一个元素的所有子元素的元素集合。可以通过可选的表达式来过滤所匹配的子元素。注意:parents()将查找所有祖辈元素,而childr...
阅读全文
posted @
2010-06-18 15:33
一粒沙
阅读(200)
推荐(0)
初学jquery之自学笔记(3)
摘要:63.为所有匹配的元素设置一个计算的属性值$(img).attr("title",function(){return this.src});64.为所有匹配的元素设置一个属性值$("img").attr("src","test.jpg");65.取得第一个匹配元素的属性值。通过这个方法可以方便地从第一个匹配元素中获取一个属性的值。如果元素没有相应属性,则返回undefined$("img").at...
阅读全文
posted @
2010-06-18 15:32
一粒沙
阅读(206)
推荐(0)
初学jquery之自学笔记(2)
摘要:38.匹配给定的属性是否包含某些值的元素$("input[name*='person']"); //表达式在find选择器中也能使用39.匹配给定的属性不包含某个特定值的元素$("input[name!='news']").attr("checked",true);40.匹配给定的属性是以某些值结尾的元素$("input[name$='car']");41.匹配给定的属性是某个特定值的元素$("i...
阅读全文
posted @
2010-06-18 15:31
一粒沙
阅读(191)
推荐(0)
初学jquery之自学笔记(1)
摘要:1.返回指定html的值 $("#msg").html(); //取值,相当于get方法 $("#msg").html("hello"); //赋值,相当于set方法2.$.get("search.do",{id:1},rend); function rend(xml){ alert(xml); } $("#msg").ajaxStart(function(){ this.html("正在加载。。...
阅读全文
posted @
2010-06-18 15:30
一粒沙
阅读(265)
推荐(0)
JQuery读取并解析xml
摘要:JQuery版本:jquery-1.4.2.min.js需要通过IIS才能正确运行DEMO.html代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<htmlxmlns="http://www.w3.org/1999/xhtml">&...
阅读全文
posted @
2010-06-18 11:41
一粒沙
阅读(2231)
推荐(0)
添加自定义对象属性
摘要:[代码]然后就可以像这样使用了:[代码]有一个奇怪的问题:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--Ext.form.FormPanelExtend=Ext.extend(Ext.form.TriggerField,{initCompone...
阅读全文
posted @
2010-06-08 18:07
一粒沙
阅读(381)
推荐(0)
ExtJs多级联动菜单的一种实现
摘要:1.ExtJs中的Combos控件,定义数据源store的时候可以采用下面的方式:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--varstore=newExt.data.SimpleStore({//定义组合框中显示的数据源//fields:[...
阅读全文
posted @
2010-06-08 18:00
一粒沙
阅读(2949)
推荐(0)