js对象内部访问this修饰的成员函数示例
用wrapper封装这样在对象内外都可以访问
function MapPool(){function createMarker(name, lat, lng, state){
var marker = new AMap.Marker({
position : new AMap.LngLat(lng, lat),
});
//the function mapMoveTo is not accessible here too
AMap.event.addListener(marker, "click",function(e){
//moveMapTo(key, name, state)
//or this.moveMapTo(key, name, state) will raise a unresolved function error
//you should write wrapper function as a member variable
_mapMoveTo(key, name, state);
});
}
var _mapMoveTo = function(key, name, state){
//TODO
}
this.mapMoveTo = function(key, name, state) {
_mapMoveTo(key, name, state);
}
}
javascript处理表单示例(javascript提交表单)
处理各种表单,以及链接,按钮的通用组件/***GenericFormprocessingjs*@authorAnthony.chen*//***Pushbuttonaction[btn_action]dataintoform*Ifthereisprescript,runtheprescript*/"usestrict";//All
js分页代码分享
htmlheadmetahttp-equiv="Content-Type"content="text/html;charset=UTF-8"titleInserttitlehere/titlescripttype='text/javascript'src='jQuery.js'/scriptstyletype="text/css"span{width:60px;height:20px;displa
javascript类型转换示例
scriptvari="123abc";i=parseInt(i);//字符串转整形alert(i+","+typeof(i));//输出:123,numberi="12.3abc";i=parseFloat(i);//字符串转浮点型alert(i+","+typeof(i));//输出:12.3,number(
编辑:一起学习网
标签:表单,示例,字符串,浮点,分页