主要是集成了常用的扩展,包括Dom与String、Array、StringBuffer、NameSpace等,当然还少不了Ajax。体积约8k。因为严格控制体积,所以功能有限。如果只要Ajax部分,就1k而已。
这个小框架已经应用到公司的项目,并开始逐步在前端展示页面上接替prototype.js。以后将围绕这个框架做一些应用。
/*
* My JavaScript Framework
* Version : 1.0 beta
* Author : misshjn
* Email : misshjn@163.com
*/
function NameSpace(){};
function StringBuffer(){this.data = []};
var Method = {
Version : "1.0 beta",
Element : function(){
this.version = Method.Version;
this.hide = function(){this.style.display="none"; return this};
this.show = function(){this.style.display=""; return this};
this.getStyle = function(s){
var value = this.style[s.camelize()];
if (!value){
if (this.currentStyle) {
value = this.currentStyle[s.camelize()];
}else if (document.defaultView && document.defaultView.getComputedStyle) {
var css = document.defaultView.getComputedStyle(this, null);
value = css ? css.getPropertyValue(s) : null;
}
}
return value;
};
this.setStyle = function(s){
var sList = s.split(";");
这个小框架已经应用到公司的项目,并开始逐步在前端展示页面上接替prototype.js。以后将围绕这个框架做一些应用。
/*
* My JavaScript Framework
* Version : 1.0 beta
* Author : misshjn
* Email : misshjn@163.com
*/
function NameSpace(){};
function StringBuffer(){this.data = []};
var Method = {
Version : "1.0 beta",
Element : function(){
this.version = Method.Version;
this.hide = function(){this.style.display="none"; return this};
this.show = function(){this.style.display=""; return this};
this.getStyle = function(s){
var value = this.style[s.camelize()];
if (!value){
if (this.currentStyle) {
value = this.currentStyle[s.camelize()];
}else if (document.defaultView && document.defaultView.getComputedStyle) {
var css = document.defaultView.getComputedStyle(this, null);
value = css ? css.getPropertyValue(s) : null;
}
}
return value;
};
this.setStyle = function(s){
var sList = s.split(";");










