I have a lua table like
Save = {
["player 1"] = {
["show"] = true,
["name"] = "user1",
["data"] = 56171308,
},
["player 2"] = {
["show"] = false,
["name"] = "user1",
["data"] = 508703367,
},}
And i want to convert it to a js array through an html page to look like
[ ["player 1","user1",56171308],
["player 2","user2",508703367] ]
I have tried to load the lua content on page and remove some elements with this function
<script>
function myFunction() {
var str = document.getElementById("file-content").innerHTML;
var res = str.replace(/Save|show|true|false|name|data|,|{|}|=|"|[[\]]/g, '');
var temp = new String(res);
temp = temp.replace(/^\s*[\r\n]/gm, '');
document.getElementById("file-content").innerHTML = temp;
}
</script>