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 13 additions and 0 deletions
+13 -0
  • shuidi-js-develope.md shuidi-js-develope.md +13 -0
  • No files found.
shuidi-js-develope.md
View page @ fe873592
......@@ -8,3 +8,16 @@ temp.js文件
![1](http://tech.pingansec.com/ulindows/tech_java/uploads/baa203c7e6536be9b2046e14ceed7f63/1.png)
<br />
![3](http://tech.pingansec.com/ulindows/tech_java/uploads/01ad68fd28a38d1fa4f85c52cf89cd77/3.png)
<br />
一个js会有一个对象,如上图中的Temp,Temp中会有Ajax和 Event两个对象,
Ajax对象中包含了所有调用ajax的方法,
注意Ajax中的return{} 只有写在return中的方法才会被其它地方调用到
比如Event对象中需要调用Ajax对象中test的方法,调用方式如 Temp.Ajax.test();
test方法必须定义在Ajax对象的return{}中
<br />
Event对象中包含了所有事件绑定有关的方法
一般写法如上图,定义一个方法,若需要绑定到dom元素上则写在eventBind方法中,
当然,如果某些方法需要在初始化的时候调用,也可以写在eventBind中,
eventBind方法会在页面初始化后执行
注意,eventBind中的方法,需写成方法调用的方法,
如有一个function showTest(){},eventBind中 写成 showTest(); 而不是 showTest
\ 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