1. run js right now
var wrapper = (function(){ var foo = "foo"; function f(){ return foo; } return f; })();
2. scrollWindow
function scrollWindow() { //window.scrollTo(document.body.scrollLeft.toString(),document.body.scrollTop.toString()); //window.scrollTo(0,0) document.body.scrollTop = 0; }
3. dynamicGetDomObject
eval("document.yourform.yourInputNamePrefix_" + index);
4. Public and Private
var MYLIB = function() { var aPrivateProperty = true; var aPrivateMethod = function() { // some code here... }; return { aPublicMethod : function() { aPrivateMethod(); // okay // some code here... }, aPublicProperty : true }; }(); MYLIB.aPrivateMethod() // not okay MYLIB.aPublicMethod() // okay
function Restaurant() { } Restaurant.prototype = (function() { var private_stuff = function() { // Private code here }; return { constructor:Restaurant, use_restroom:function() { private_stuff(); } }; })(); var r = new Restaurant(); // This will work: r.use_restroom(); // This will cause an error: r.private_stuff();
format Date
console.log(d.getHours()+"-"+d.getMinutes()+"-"+d.getSeconds()+"-"+d.getMilliseconds());
相关推荐
myjs
名称:MyJS_DivMessage 作者:高翔 版本:MyJS_DIVDialogV1.10.js(支持换肤和自定义内容) 支持浏览器:IE 将在1.1版本中推出 ******************************************* 参数介绍: innerDivId:依附层ID ...
myjs 一个简单JavaScript Facade库,方便了我的生活。演示版在此处查看演示: : 安装只需在您的网页中包含myjs.min.js文件即可。 < script src =" ...
Javascript各种操作类
myjs.rar javaScript demo 共20个类,343个例子
实用的js库,网页制作方面,源代码,效果页面都有
MyJs 我的JS代码工具库: template.js js模板引擎 var tmplHTML = '<P><%- title %></P><% if(content){ %><P><%= content %></P><% } %>', tmplFunc = template( tmplHTML ), ...
myjs.js
MyJS Javascript库
jsdat:myjs dt
框架 myJS 是为提高生产力而开发的。 一些插件甚至使用 jQuery 库以获得更高的性能增益。
myjs-project.io 学习JavaScript
this is my js at the project of bank
JavaScript实例
s2+='<li id="Myjs'+i+'" onmouseover="Myjsch(\'Myjs'+i+'\',\''+mypic[i]+'\')" onmouseout="Myjscl(\'Myjs'+i+'\')" ref="'+mypic[i]+'">(mylnk[i])+'">'+mytxt[i]+'</a></li>'; } document.getElementById('...
我的js,base,js等文件,
名称:MyJS_DivMessage 作者:高翔 版本:MyJS_DIVDialogV1.10.js(支持换肤和自定义内容) 支持浏览器:IE所有系列 ******************************************* 参数介绍: innerDivId:依附层ID divBlotId:...
chatImg-path: D:\MyJS\MixPet\chatImg\ # 聊天图片存储路径 ``` 3. 修改完成之后,进入本项目下的`shipPet/src/main`文件夹,运行`ShipPetApplication.java`文件即可。 【备注】 1、该资源内项目代码都经过测试...