jquery ajax json table 添加行,jquery mobile ajax插入table不需json

.net确实是要json php解释方式不同

jquery mobile两个页面以及源码(登录与注册)

Mr_kimilo 发表于 2011-10-12 17:06 1年前, 8回/5890阅, 最后回答: 2个月前 开源中国 5 周年,史上最牛定制开源马克杯!

先上图:

登录:

注册:

登录核心代码:

view sourceprint?01

02      jQuery(document).ready(function() {

03         //输入事件

04         $("input[id]").bind("focus",function () {

05         if($(this).attr("id")=='username'||$(this).attr("id")=='password')

06         $(this).attr("value","");

07         });

08         //提交

09         $("#submit").bind("click", function() {

10               if (valid()) {

11                 $.ajax({

12                    type: "POST",

13                    url: "http://localhost:8080/note/servlet/Login",

14                    data: $("form#loginform").serialize(),

15                    success: function(msg){

16                      if(msg=='success'){

17                         $.mobile.changePage("content/first.html","slidedown", true, true);

18                      }else{

19                         $.mobile.changePage("content/loginfalse.html","slidedown", true, true);

20                      }

21

22                    }

23                 });

24               }

25             });

26         });

27         //输入信息验证

28         function valid(){

29             if($("#username").attr("value")==''||$("#password").attr("value")=='')

30             {

31                 $.mobile.changePage("content/loginfalse.html","slidedown", true, true);

32                 return false;

33             }

34             return true;

35         };

36     

37

38     

39     p {

40         font-size: 1.5em;

41         font-weight: bold;

42     }

43     #submit{

44         float:right; margin:10px;

45     }

46     #toregist{

47         float:left; margin:10px;

48     }

49     

50

51

52

53

54   

开始笔记之旅

55   

56     

登录微笔记

57         

58            

59            

60                     

61                        

62                         保持登录状态

63                     

64             注册

65             登录

66         

67   

68   

©2011 TinyNote 微笔记社区(movingcomputing.com)

69

70

71

72

73

74

注册核心代码:

view sourceprint?01

02      jQuery(document).ready(function() {

03         //输入事件

04         $("input[id]").bind("focus",function () {

05         if($(this).attr("value")=='用户名'||$(this).attr("value")=='密码')

06         $(this).attr("value","");

07         });

08         //提交

09         $("#regist").bind("click", function() {

10               if (true) {

11                 $.ajax({

12                    type: "POST",

13                    url: "http://localhost:8080/note/servlet/Login",

14                    data: $("form#loginform").serialize(),

15                    success: function(msg){

16                      if(msg=='success'){

17                         $.mobile.changePage("../content/first.html","slidedown", true, true);

18                      }else{

19                         $.mobile.changePage("../content/loginfalse.html","slidedown", true, true);

20                      }

21

22                    }

23                 });

24               }

25             });

26         });

27     

28

29     

30     p {

31         font-size: 1.5em;

32         font-weight: bold;

33     }

34     header div{

35         font-size: 1.5em;

36     }

37     #regist{

38         width:150px;

39         height:50px;

40         margin :5px;

41     }

42     

43

44

45

46

47

48   

49     

50         

51            

52                 

注册微笔记

53                 

用手机号注册

54            

55         

56     

57   

58   

59         

60         邮 箱

61         

62         密 码

63         

64         昵 称

65         

66         

67             身 份:

68            

69             上班族

70

71            

72             大学生

73

74            

75             其他

76         

77            

78                 立即注册

79            

80         

81   

82

83

84

http://www.oschina.net/question/101738_29271

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值