Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W
wiki-java
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • 老徐
  • wiki-java
  • Wiki
  • shuidi js develope

shuidi js develope · Changes

Page history
meijh created page: shuidi js develope authored Jul 08, 2016 by 梅俊辉's avatar 梅俊辉
Hide whitespace changes
Inline Side-by-side
Showing with 2 additions and 71 deletions
+2 -71
  • shuidi-js-develope.md shuidi-js-develope.md +2 -71
  • No files found.
shuidi-js-develope.md
View page @ 5923f786
...@@ -5,74 +5,5 @@ common文件夹下的其他js文件均不可再用 ...@@ -5,74 +5,5 @@ common文件夹下的其他js文件均不可再用
通常一个页面对应一个js文件,js文件中包含了关于此页面的所有js代码,js代码需要按照模板规定来开发,模板如下: 通常一个页面对应一个js文件,js文件中包含了关于此页面的所有js代码,js代码需要按照模板规定来开发,模板如下:
<br /> <br />
temp.js文件 temp.js文件
![1](http://tech.pingansec.com/ulindows/tech_java/uploads/ff236661c385655ab17bbc7515eff5be/1.png)
/** ![2](http://tech.pingansec.com/ulindows/tech_java/uploads/8a0a8fec1de434de1715666252db35b1/2.png)
* 创建了一个Temp对象,
*/
var Temp = Temp || {};
(function($){
/**
* 所有的ajax方法都定义在这里
*/
Temp.Ajax=(function(){
/** 加载div内容的 ajax 回调函数方法 */
var loadDivContentCallback=function(data){
$("#all").text(data);
};
/** 加载div内容的的 ajax方法 */
var loadDivContentAjax=function(jsondata){
//创建ajax参数对象
var params=new AjaxObj(jsondata,"test/ajax",loadDivContentCallback);
//调用common.js中的通用ajax方法
Pingan.ajax(params);
};
/**
* 所有的ajax要执行的初始化事件定义在这里面
*/
var ajaxInitExecute=function(){
loadDivContentAjax();
}
return{
ajaxInit:ajaxInitExecute
};
})();
//定义事件绑定
Temp.Event=(function(){
function show(){
alert('test');
}
/**
* 所有的js元素绑定事件写在这里
*/
var eventBind=function(){
$("#clickMe").click(show);
};
//返回对象
return{
eventInit:eventBind
};
})();
/**
* 初始化方法
* 所有要在页面加载后执行的代码都放在这里
*/
$(function(){
Temp.Ajax.ajaxInit();
Temp.Event.eventInit();
});
})(jQuery);
\ No newline at end of file
Clone repository
  • git configuration and simple use
  • Home
  • java code specification
  • maven environment configuration
  • shuidi js develope
  • ucs_project environment configuration