如何在ajax请求中设置特殊的RequestHeader
1个回答
展开全部
<script type="text/javascript" language="javascript">
$(function() {
$("#test").click(function() {
$.ajax({
type: "GET",
url: "default.aspx",
beforeSend: function(request) {
request.setRequestHeader("Test", "hello world");
},
success: function(result) {
alert(result);
}
});
});
});
</script>
$(function() {
$("#test").click(function() {
$.ajax({
type: "GET",
url: "default.aspx",
beforeSend: function(request) {
request.setRequestHeader("Test", "hello world");
},
success: function(result) {
alert(result);
}
});
});
});
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询