This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文章1 | |
2 | |
3 | |
4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//下面是我的代码 | |
function test(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author longxiao.fq | |
* @date 2011 02 12 | |
* FactionSwapper 帮派插件组件 | |
*/ | |
;(function(){ | |
TShop.add('mods~FactionSwapper',function(){ | |
TShop.mods.FactionSwapper=function(){ | |
var S = KISSY, DOM = S.DOM, doc = document, el , overTime=5000,__callback, elNode = "#J_ShopBangPaiWidget"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @flieoverview 不基于YUI3的模仿YUI3的base功能的一些原生代码实现 | |
* 首先简述一下,YUI3的base是什么。 | |
* Base是一个YUI3的一个基础类,通过继承Base可以以一种统一的方式创建自己的具有新的属性、并可作为事件目的(Event target)的类。 | |
* | |
* 简单说一下分析结构和思路,在YUI3的base类中,首先继承了Attribute基类,Attribute又继承了Event-custom,也就是EventTarget类,通过他们2个的功能组合又实现的base类 | |
* | |
* 在具体的代码实现中,只按照base的API实现的基本的几个功能,按照自己的思路进行的组织,实现为 | |
* _Event | |
* _Attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var G = {}; | |
G.Game = function() { | |
var start = ""; | |
this.boxWidth = 25;//单位宽度 | |
this.boxHeight = 15;//单位长度 | |
this.blockWidth = 30; //单位块 | |
this.speed = 200; //运动速度 | |
var blockWidth = this.blockWidth - 2;//border为1 预留 | |
var _this = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lang = function() { | |
var types = ["Array", "Object", "String", "Number"], | |
ret = {}; | |
for (var i = 0; i < types.length; i++) { (function(i) { | |
var type = types[i]; | |
ret['is' + type] = function(arg) { | |
return lang._typeof(arg) === "[object " + type + "]"; | |
} | |
})(i) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(isEqual(1,1)) | |
console.log(isEqual(1,"1")) | |
console.log(isEqual("a","a")) | |
console.log(isEqual(1,2)) | |
console.log(isEqual([[],1],[[],2])) | |
console.log(isEqual([{},1],[{},2])) | |
console.log(isEqual({},1)) | |
console.log(isEqual([],1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var events=require('events').EventEmitter; | |
var test=function(){ | |
events.call(this); | |
} | |
test.prototype=Object.create(events.prototype,{ | |
constructor:{ | |
value:test, | |
enumerable:false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var events=function(){ | |
this.map={}; | |
}; | |
events.prototype={ | |
emit:function(eventname,args){ | |
if(this.map[eventname]){ | |
this.map[eventname].forEach(function(fn){ | |
fn.apply(this,args); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form name="frmMain"> | |
<input name="fireTarget"> | |
<input type="hidden" name="output"> | |
</form> | |
<script> | |
function changeRealElement () { | |
var torgand = document.frmMain["fireTarget"]; | |
var realElem = document.frmMain["output"]; |
OlderNewer