- /**
- * js 模板,所有页面控制js,以闭包形式编写代码,降低浏览器内存消耗,加快运行速度
- * 请按照此结构编写,便于后期前端维护和修改
- */
- /*如果页面 引入了多个控制js,那么请声明命名空间,否则会引起变量冲突。 */
- /*声明 命名空间*/
- var userregedit={};
- userregedit.PageOper=(function(){
- /*变量初始化*/
- var _url="user/regeidt";
- return{
- /*页面初始化*/
- init:function(){
- },
- /*页面dom事件绑定*/
- bind:function(){
- },
- /*页面数据提交操作*/
- submit:function(){
- }
- }
- /*所有页面值获得均可用对象返回 */
- function getUserValue(){
- return {
- account:$("#user_account").val(),
- passwd:$("#user_passwd").val(),
- verify_code:$("#verify_code").val()
- };
- }
- /*other function defined below
- * like:callback fun,data verify fun...
- * */
- })();
- /*方法调用*/
- userregedit.PageOper.init();
- /*如果你使用了jquery 可以这么写*/
- $().ready(function(){
- userregedit.PageOper.init();
- });
- //该片段来自于http://www.codesnippet.cn/detail/261120137501.html
来源: http://www.codesnippet.cn/detail/261120137501.html