96545c618a
Documentation of metadata functions/methods
42 lines
1.3 KiB
HTML
42 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<script src="http://play.workadventure.localhost/iframe_api.js"></script>
|
|
</head>
|
|
<body>
|
|
<button id="getNickName">nickname</button>
|
|
<div id="nickname"></div>
|
|
|
|
<button id="getRoomID">roomID</button>
|
|
<div id="roomID"></div>
|
|
|
|
<button id="getUUID">UUID</button>
|
|
<div id="UUID"></div>
|
|
|
|
<script>
|
|
document.getElementById('getNickName').onclick = () => {
|
|
WA.getNickName().then((res) => {
|
|
const nickNameDiv = document.createElement('p');
|
|
nickNameDiv.innerText = res;
|
|
document.getElementById('nickname').append(nickNameDiv);
|
|
});
|
|
}
|
|
|
|
document.getElementById('getUUID').onclick = () => {
|
|
WA.getUuid().then((res) => {
|
|
const uuidDiv = document.createElement('p');
|
|
uuidDiv.innerText = res;
|
|
document.getElementById('UUID').append(uuidDiv);
|
|
});
|
|
}
|
|
|
|
document.getElementById('getRoomID').onclick = () => {
|
|
WA.getRoomId().then((res) => {
|
|
const roomidDiv = document.createElement('p');
|
|
roomidDiv.innerText = res;
|
|
document.getElementById('roomID').append(roomidDiv);
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |