- <script src1="jquery-1.11.0.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- /* 定义 */
- function m_main() {
- this.m_click = function () {
- this.m_test = js_test(),
- this.m_test1 = js_up()
- }
- }
- /* 实现 */
- function js_test() {
- alert("test1");
- }
- var js_up = function () {
- alert("test2");
- };
- /* 调用 */
- $("#main").click(function () {
- var m_click = new m_main().m_click();
- m_click.m_test;
- m_click.m_test1;
- });
- </script>
- //输出:
- //test1
- //test2
- //该片段来自于http://www.codesnippet.cn/detail/130620149760.html
来源: http://www.codesnippet.cn/detail/130620149760.html