嗨,我尝试在div中显示ajax成功。但是它没有显示。当我单击开始考试时,成功只是闪烁而消失。我的代码在这里
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<head>
<script>
$(document).ready(function(){
$('#qp').click(function(){
var roll='<?php echo $roll; ?>';
var branch=roll.substring(6,8);
$.ajax({
url:'test4.php',
type:'post',
data:'br='+branch+'&rno='+roll,
success:function(result)
{
$('#qns').html(result);
}
});
});
});
</script>
</head>
<body>
<div>
<ul>
<li><a href="" id="qp">Start Exam</a></li>
<li><a href="">Logout</a></li>
</ul>
</div>
<div id="qns">
</div>
</head>
</body>
</html>