Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  $("#btn1").click(
  2.             function () {
  3.                 if ($("#titleBlockWrapper > div > .content").css("display") === "block") {
  4.  
  5.                     $("#titleBlockWrapper > div > .content").css("display", "none");
  6.                     $("#titleBlockWrapper > div > form").css("display", "block");
  7.                 }
  8.                 else {
  9.                     $("#titleBlockWrapper > div > .content").css("display", "block");
  10.                     $("#titleBlockWrapper > div > form").css("display", "none");
  11.  
  12.                     jQuery.ajax({
  13.                         url: "update.php",
  14.                         type: "POST",
  15.                         dataType: "html",
  16.                         data: jQuery("#titleBlockWrapper > div > form").serialize(),
  17.                         success:
  18.                             function(response) {
  19.                                 var result = jQuery.parseJSON(response);
  20.                                 $("#titleBlockWrapper .content").html(result.pageContent);
  21.                             },
  22.                         error:
  23.                             function(response) {}
  24.                     });
  25.  
  26.                 }
  27.                 return false;
  28.             }
  29.         );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement