分享一个小技巧,个中乐趣请跨站师们自己体会:

<script type="text/javascript">
<!--
function func2URL(proc) {
    
return "javascript:(" + encodeURIComponent(proc.toString()) + ")();";
}

function test() {
    
var a = "hahaha\x41\x42";
    
var b = function(s) {
        alert(s);
    };
    
    b(a);
}

document.write(func2URL(test));
location.href 
= func2URL(test);
//-->
</script>

 

相关文章:

  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-06-06
相关资源
相似解决方案