HTML5 and Javascript Character Saving

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏