好的,我有一些要回显的Javascript代码。

这是我想回显的代码,我希望它基本上打印出生成的“医院”和“加扰”的响应,我到目前为止已经无法在PHP中回显结果。

<script language="JavaScript">
<!--
 function hospital() {
  var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
  var string_length = Math.floor(Math.random() * (3000 - 256 + 1)) + 256;
  var prngstring = '';

  for (var i = 0; i < string_length; i++) {
   var rnum = Math.floor(Math.random() * chars.length);
   prngstring += chars.substring(rnum,rnum+1);
  }
  document.theform.hospital.value += prngstring;
 }

 function catchme() {
     var rounds = 812;
        var scramble = "lbwnaoJJgJbQCc1zxfiQugycOhboPrdbciAVBaBeqnzXzhztbPddaBWzNjcrafefibAcnJohbDQDbuaueudckuGvAuccEhPmehbjZdaecgAMphcPAeabFvxsGwteWS";

        for (var i = 0; i <= rounds; i++) {
            scramble = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(scramble)).toUpperCase();
        }
        document.theform.waste.value += scramble;
        hospital();
    }
-->
</script>


将不胜感激和支持。

最佳答案

没有调用catchme函数。您需要调用catchme函数,以便以下语句起作用。


document.theform.waste.value + =加扰;
document.theform.hospital.value + = prngstring;


使catchme成为自调用函数。

(function catchme() {
     var rounds = 812;
        var scramble = "lbwnaoJJgJbQCc1zxfiQugycOhboPrdbciAVBaBeqnzXzhztbPddaBWzNjcrafefibAcnJohbDQDbuaueudckuGvAuccEhPmehbjZdaecgAMphcPAeabFvxsGwteWS";

        for (var i = 0; i <= rounds; i++) {
            scramble = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(scramble)).toUpperCase();
        }
        document.theform.waste.value += scramble;
        hospital();
    })();

10-06 04:11