我试图简单地用ajax / jquery发布值并在ASP classic中打印出来。
当我检查开发者工具中的网络选项卡时,它将delete_id和tbl显示为已发布的值,但它们不会显示在我的代码中。
<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 you sure you want to delete this entry?"))
{
$.ajax({
type: "POST",
url: "admin.asp",
data: info,
success: function(){
}
});
$(this).parent().parent().fadeOut("slow", function() {
$(this).remove();
});
}
return false;
});
});
</script>
<%
dim i
i = Request.Form("tbl")
Response.Write(i)
%>
答案 0 :(得分:0)
$(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 you sure you want to delete this entry?"))
{
$.ajax({
type: "POST",
url: "admin.asp",
data: info,
success: function(response){
$("#yourControlid").val(response); //This do the trick
}
});
$(this).parent().parent().fadeOut("slow", function() {
$(this).remove();
});
}
return false;
});
});
admin.asp
<%
i = Request("tbl")
Response.Write(i)
%>