return false Why does the a tag still jump?
Weaving
Weaving 2019-05-26 15:34:03
0
1
1592

<script>

window.onload=function(){

document.getElementsByTagName('a')[0].onclick=function(){

var request=new XMLHttpRequest();

                                                                                                              ’     ’ ’ s                     out out way out through out way out through outce out out out out out out out out out out off to ’'s' ‐ ‐ ‐ww's' ;

request.send(null); //Send Ajax request to the server, the get here does not need to pass parameters

request.onreadystatechange=function(){ //Continuously monitor the server side Response

if(request.readyState==4&&request.status=200){ //The request status is 4 and the request code is 200, which means the server effect is successful

document.getElementsByTagName('h3' )[0].innerHTML=request.responseText //Get the text information and display it at the h3 position

}

}

return false ; / /Cancel the default jump behavior of a tag

}

}

</script>

Weaving
Weaving

reply all(1)
Mr.jiang

request.readyState==4&&request.status=200

Look carefully at this code

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template