Jquery js框架使用

 jquery  众所周知 ,强大的 js框架



自己使用的一些笔记

  1. //1.json格式定义方法
  2. var product_obj={ 
  3.   check_init:function(){ 
  4.        $("input[name=Name]").blur(function(){ 
  5.        }    
  6.     }
  7. }
  8. //页面调用
  9. $(product_obj.check_init)
  10. //2.给控件绑定事件
  11. $("input[name=Name]").blur(function(){ 
  12.        }  
  13. //3.获取节点,节点属性修改,css修改等
  14. $("input:radio:checked")
  15. $("input:checkbox:checked")
  16. $('#checkout .address dl')
  17. $('#checkout .address dl').css('display', 'none');
  18. $("#address_form").attr({"action":"user_addAddressBook","method":"post"})
  19. $("#a_next").remove();
  20. $(".pro_img .list img").each(function(){
  21.      global_obj.image_init(this,$(this).parent().width(),$(this).parent().height())
  22.  })
  23. $(this).parent()
  24. //4.节点的获取
  25. $("#address_form [name=address_book_mod]")
  26. $("from[name=fileupload]")
  27. //5.引入其他文件
  28. $("#main_order").load("addAddressBook.jsp");
  29. //6.ajax的使用
  30.     
  31. $.ajax({
  32.        type: "POST",
  33.        url: url,
  34.        data: data,
  35.        success: function(msg){
  36.      if(status=="reload"){
  37.       location.reload();
  38.      }else if(status=="html"){
  39.       $(include).html(msg);
  40.      }
  41.        }
  42.    });
  43. //表单的提交
  44. $.post('user_register', $('#user_form').serialize(), function(data){
  45.      if(data[0]=="1"){location.href=data[1]}else if(data[0]=="2"){global_obj.win_alert(data[1])};
  46.    });
  47. //post普通提交
  48. j.post('/oaproveuploadmgr.do', { method:"delprovefile",state: "4" ,msgid:'${msgInfoMap.ID}',userid:'${user.id}',delpath:filepath},function(data){
  49. if(data == 'success'){
  50. j(j(obj).parents("table")[0]).remove();
  51. if(j("#pFileDisplayHtml table").size()==0){
  52. j("#prove_state").html("未证明");
  53. }
  54. }else{
  55. alert(data);
  56. }
  57. });
  58. //多库共存
  59. var j = jQuery.noConflict();
  60. //jquery 关于在ifarme 中获取父窗口的方式
  61. $("input[name=datamsgid]",parent.document).val('<%=request.getAttribute("dataMsgId")%>');
  62. $("form[name=uploadform]",parent.document).remove();
  63. //添加  append


待续......

附件:
jquery-1.9.1.min.js
jquery文档.chm

自己写的 :

productvalidate.js


附件列表

    原文地址:https://www.cnblogs.com/signheart/p/6598133.html