jquery - Retrieving POST data from Ajax in ASP Classic -
i'm trying post values ajax/jquery , print out in asp classic.
when check network tab in developer tools shows delete_id , tbl posted values dont display in code.
<script> $(document).ready(function(){ $('input#del-policy').click(function(){ var element = $(this); var del_id = element.attr("name"); var info = "delete_id=" + del_id + "&tbl=policies"; if(confirm("are sure want delete entry?")) { $.ajax({ type: "post", url: "admin.asp", data: info, success: function(){ } }); $(this).parent().parent().fadeout("slow", function() { $(this).remove(); }); } return false; }); }); </script> <% dim i = request.form("tbl") response.write(i) %>
try this:
$(document).ready(function(){ $('input#del-policy').click(function(){ var element = $(this); var del_id = element.attr("name"); var info = "delete_id=" + del_id + "&tbl=policies"; if(confirm("are sure want delete entry?")) { $.ajax({ type: "post", url: "admin.asp", data: info, success: function(response){ $("#yourcontrolid").val(response); //this trick } }); $(this).parent().parent().fadeout("slow", function() { $(this).remove(); }); } return false; }); });
asumming admin.asp
<% = request("tbl") response.write(i) %>
Comments
Post a Comment