search

Home  >  Q&A  >  body text

Why does it still jump after returning false?

<script> // Ajax let btn = document.getElementById("submit"); btn.onclick = function () { //new an ajax object let xhr = new XMLHttpRequest(); // Monitoring xhr.onreadystatechange = function () { // Sent successfully and successfully received from the server if (xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); // Parse the returned json string; / / let json = json.parse (xhr.Responsetext); // Write into html; // Let tips = document.GetelementByid ("tips"); // tips.innerhtml = "Welcome user" json.name "to come back again. ";                                                                                                                                                                         let name = document.getElementById("username").value; "&password=" password;

P粉751989631P粉751989631746 days ago635

reply all(0)I'll reply

No reply
  • Cancelreply