xapiwrapper.min.jsとそのようなファイルを使用して、LRSに文を送信しています。 javascriptを含む私自身のファイルはinit.jsと呼ばれ、以下に示されています。 Init.jsは他のメインのhtml5ファイルから参照されます。私のinit.jsファイルをさらに見ると、ADL LRSの資格情報が表示されます。これをユーザーが見ることができないようにする方法はありますか?LRSとのやりとりで認証資格情報を非表示または保護する方法
init.jsはありません、効果的
<!--This happens when the user clicks the Submit button.-->
$("#myButton").click(function(){
//creating a couple of local variables
var name = $("#nameID").val();
var email = $("#emailID").val();
if(name=='') {
alert("Please enter a name");
myForm.name.focus();
return (false);
}
if(email=='') {
alert("Please enter an email");
myForm.name.focus();
return (false);
}
//creating global variables
setGlobal(email, name);
//move to page 2
document.location.replace("tableOfContents.html");
});
//Setting some global variables in case we need them later.
function setGlobal(actEmail, actName) {
// Save the name in localStorage.
localStorage.setItem('name', actName);
// Save the email in localStorage.
localStorage.setItem('email', actEmail);
}
<!--When the user clicks the feedback link-->
$("#feedback").click(function(){
window.open('mailto:[email protected]?subject=Feedback on MS Office 365 tutorials');
});
<!--When the user clicks the logout link-->
$("#logout").click(function(){
localStorage.removeItem("name");
localStorage.removeItem("email");
document.location.replace("index.html");
});
// Auth for the ADL LRS
var conf = {
"endpoint" : "https://lrs.adlnet.gov/xapi/",
"user": "xapi-tools",
"password": "xapi-tools",
"auth": "xapi-tools"
};
$("#myModal").on('hidden.bs.modal', function (e) {
$("#myModal iframe").attr("src", $("#myModal iframe").attr("src"));
});
1)OAuthを使用すると、OAuthがより簡単であれば、上記の提案を簡単にすることができます。 私は1文字を編集できません:( – garajo