运行的Base64加密后的JavaScript code [英] Run JavaScript Code after Base64 encryption

查看:173
本文介绍了运行的Base64加密后的JavaScript code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经加密我的JavaScript code用的base64方法像所示的此处。但是,当我运行的document.ready的EN code函数,JavaScript函数没有做它应该。

I have encrypted my JavaScript Code with the base64 method like shown here. But when I run the encode function with document.ready, the JavaScript function doesn't do what it should.

我如何认识它,加密code进行解密,并开始RUND功能?

How do I realize it, that the encrypted code will be decrypted and start to rund the function?

感谢你在前进! :)

推荐答案

只需使用评估在德codeD字符串。

Just use eval on the decoded string.

例如,使用code 警报(测试);

Example using the code alert("test");:

eval(decode64('YWxlcnQlMjglMjJ0ZXN0JTIyJTI5JTNC'));

演示: http://jsfiddle.net/uFxnz/

请注意:使用评估功能与不安全和低效率的code有关,但在这种情况下,您对其中code是尽可能多的控制从,你可以过来,所以它做的只是你想要它做的事。

Note: Using the eval function is associated with unsafe and inefficient code, but in this case you have as much control over where the code is coming from as you can, so it's doing just what you want it to do.

这篇关于运行的Base64加密后的JavaScript code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆