나는 폼을 게시하고 홈 페이지로 리다이렉트하는 자바 스크립트 함수를 작성했다. 메신저는 window.location.replace를 사용하여 홈페이지로 이동합니다. 대신 url을 바꾸는 대신에 함수는 현재 url 앞에 url을 추가합니다. 뭐가 문제 야?window.location.replace not working
$('#submit_fourth').click(function() {
// send data to server to save in table dbo.aspnet_Users =================================================
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
var username = $("#username").val();
var password = $("#password").val();
var email = $("#email").val();
$.post("/Account/Register", { FirstName: firstname, LastName: lastname, UserName: username, Password: password, ConfirmPassword: password, Email: email });
//send information to server
alert('Congratulations! Your account has been sucessfully created.');
//get back to the login screen
window.location.replace("dgsmart/Central/Login");
있는 현재의 URL 내가 URL이 184.180.25.240/dgsmart/central/을 LYK 원하는 등록 버튼 후 184.180.25.240/dgsmart/account/register 그것이 을 184.180.25.240/dgsmart/account/central/login된다 클릭입니다 로그인
을 이상적인 URL을 설정하려면이 코드를 사용하지만, 교체 할 수 있습니다. 그 사람이 upvote 또는 응답을 받아들이기를 기다리는 나중에 나중에 부분을 제거 할 수 –
그것을 대체하는 대신 URL을 계속 추가 : |. 나는 window.loaction과 window.location.href를 시도했지만 성공하지 못했다. – rao