I am trying to update my Pathfinder Character generator to have the ability to save a character by using HTML5's web storage. I have a JavaScript file used to generate the character.
However, I'm running into a few problems. How can I make it so that only things that have been updated changed when clicking my "Update Character" button? Secondly, what would the best way to go about showing the results?
This is my current code:
function SaveCharacter() {
makeCharacter();
if (typeof(Storage) !== "undefined") {
if (localStorage.used) {
alert("used was true.");
localStorage.name = name;
}
else {
localStorage.used = true;
localStorage.name = name;
localStorage.skill_points = num_skill_points;
localStorage.spells = num_spells;
localStorage.feats = num_feats;
localStorage.hitdie = hit_die;
localStorage.wealth = wealth;
localStorage.Class = Class;
// localStorage.Scores = new Array();
// for (var i = 0; i
以上就是HTML5 and Javascript Character Saving的详细内容,更多请关注web前端其它相关文章!