为了账号安全,请及时绑定邮箱和手机立即绑定

将保存代码放在文本框中,然后将变量更改为该保存代码

将保存代码放在文本框中,然后将变量更改为该保存代码

LEATH 2021-03-30 21:14:57
我回来了,我尝试了一下,但是任何可以帮助的人都不起作用???我已经设置了保存机制。(我必须添加额外的文本,因此这与脚本本身无关)这是我用来测试保存机制的代码。<!DOCTYPE html><html><body><button onclick="point();">points</button><button onclick="upgrade()">upgrade</button><script language="javascript">var pointcount = 0;var totalcliks = 0;var upgrades = 0;function point() {pointcount++;totalcliks++;}function upgrade() {upgrades++;pointcount--;}function load() {  var testerload = document.getElementById("savecodetextbox").value;  document.getElementById("saveshow").innerHTML = testerload;}var pointcounterclock = setInterval(function() {pointcounter()},100);    function pointcounter(){    document.getElementById("points-screen").innerHTML = pointcount+" points";    document.getElementById("clicktotal").innerHTML = totalcliks+" totalcliks";    document.getElementById("savecode").innerHTML = totalcliks+"a"+ pointcount+"a"+ upgrades;    }let savecode = "1a1a1"; //grab the input for savecode herelet codes = savecode.split("a");if(codes.length == 3){ //verify the length is correct    totalcliks = codes[1];    updates = codes[2];    pointcount = codes[3];}</script><h3 id="points-screen"></h3><h3 id="clicktotal"></h3><h3 id="savecode"></h3><textarea name="text_area" id="savecodetextbox" rows="4" cols="40"></textarea> <button onclick="load()">load</button><h3 id="saveshow"></h3></body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 150 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信