Fix: go home button

This commit is contained in:
2018-07-12 14:54:45 +09:00
parent a0e0702370
commit a549a63491
10 changed files with 174 additions and 91 deletions
+19 -36
View File
@@ -15,40 +15,14 @@
<script>
function loadMaestroTestAccountInfo() {
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/maestro_test_account.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send();
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
// console.log(xhr.responseText);
// console.log(xhr.responseText.length);
if(xhr.responseText.length === 0 || xhr.responseText === null) {
console.log("no data from server");
return;
}
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/maestro/maestro_test_account.php",
"",
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
if(replyJSON === null) {
console.log("no data from server");
return;
}
if(replyJSON["ERROR"] !== undefined || replyJSON["RESULT"] === undefined) {
console.log(replyJSON["ERROR"]);
return;
}
if(replyJSON["RESULT"] === "fail") {
console.log(replyJSON["RESULT"]);
return;
}
let maestroID = replyJSON["maestroID"];
let playerID = replyJSON["playerID"];
let playerName = replyJSON["playerName"];
(jsonData) => {
let maestroID = jsonData["maestroID"];
let playerID = jsonData["playerID"];
let playerName = jsonData["playerName"];
console.log("maestroID : " + maestroID);
console.log("playerID : " + playerID);
@@ -57,13 +31,22 @@ function loadMaestroTestAccountInfo() {
sessionStorage.setItem("maestroID", maestroID);
sessionStorage.setItem("playerID", playerID);
sessionStorage.setItem("playerName", playerName);
},
(errorMessage) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
}
);
let xhr = new XMLHttpRequest(); //new로 생성.
}
function playFree() {
loadMaestroTestAccountInfo();
window.open("./../client/menu_app.html", "_blank");
// window.open("./../client/menu_app.html", "_blank");
location.href = "./../client/menu_app.html";
}
function experienceMaestro() {
@@ -116,7 +99,7 @@ function experienceMaestro() {
</ul>
<div class="col alignCenter">
<a href="./../maestro/register.html" id="maestro_register" class="btn btn-sea width400">마에스트로<br/>가입</a>
<a href="./../main/register.html" id="maestro_register" class="btn btn-sea width400">마에스트로<br/>가입</a>
</div>
<ul id="register_tip">