Jump to content

shin

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by shin

  1. The following codes, which was directly copied from tryit editor source with alert()'s show that the php server codes does not accept saved data correctly now. globalURL = 'https://tryit.w3schools.com/code_datas.php'; --------- <!DOCTYPE html> <html> <head> <title>Simulation SaveFile of TryIt Editor</title> <div id="preSave">preSave</div> <div id="errorSave">errorSave</div> <div id="postSave" style="color:red">postSave</div> <hr> <button onclick="saveFile(`document.getElementById('textareaCode').value`)">saveFile</button> <hr> <a id="shareLink" style="color:red" href="javascript:void(0);">shareLink</a> <div id="shareLinkText" style="color:red">shareLinkText</div> <div id="saveLoader" style="color:red">saveLoader</div> <div id="saveModalSaved" style="color:red">saveModalSaved</div> <script> globalURL = 'https://tryit.w3schools.com/code_datas.php'; function saveFile(code) { alert('length='+code.length); document.getElementById('preSave').style.display='none'; if (code.length>20000) { document.getElementById('errorSave').style.display='block'; return; } document.getElementById('postSave').style.display='block'; var paramObj = {}; paramObj.code = code; var paramB = JSON.stringify(paramObj); alert('paramB= ' + paramB); var httpB = new XMLHttpRequest(); httpB.open("POST", globalURL, true); httpB.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpB.onreadystatechange = function() { alert(httpB.readyState + httpB.status); if(httpB.readyState == 4 && httpB.status == 200) { if(httpB.responseText.substr(0,2) == "OK" ) { var getId = httpB.responseText.substr(2); document.getElementById("shareLink").href = "/code/tryit.asp?filename=" + getId; document.getElementById("shareLinkText").innerHTML = "https://www.w3schools.com/code/tryit.asp?filename=" + getId; document.getElementById('saveLoader').style.display = "none"; document.getElementById("saveModalSaved").style.display = "block"; } // "OK" } // 4 && 200 } // onreadystatechange httpB.send(paramB); } </script> </head> <body> <h1>This is a test/simulation on W3Schools saveFile() function</h1> <p>Post to <script>document.write(globalURL);</script> is being tested.</p> <p style="color:red">Status codes: 202, 203, 204 are returned</p> <p>204: Empty Content. Server successfully executed request but without return anything.</p> </body> </html>
  2. Yes. We are suffering the same problems. (1) Unable to save HTML pages now. (2) Saved HTML/JavaScript codes are gone (past links cannot bring back our codes.) The site seems to have physical storage problems for the past few days. Please help us to resolve the problems asap. Thanks.
×
×
  • Create New...