JSEncrypt is not a constructor?在调用匿名函数 报这个错误,要怎么样修改啊?

胖多多是我 2017-03-18 12:01:21
JSEncryptExports={};
(function(ap){var bE;
var JSEncrypt=JSEncryptExports.JSEncrypt;
function test(pwd) {
var encrypt = new JSEncrypt();////在创建对象的时候 报JSEncrypt is not a constructor 错误
}

这个要怎么修改啊 迷糊了
...全文
3107 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
( ap.JSEncryptJSEncrypt=a3})(JSEncryptExports); 这里错了啊。。===》 (function (ap) { ap.JSEncryptJSEncrypt = a3 })(JSEncryptExports);
胖多多是我 2017-03-18
  • 打赏
  • 举报
回复
引用 楼主 north55 的回复:
JSEncryptExports={}; (function(ap){var bE; var JSEncrypt=JSEncryptExports.JSEncrypt; function test(pwd) { var encrypt = new JSEncrypt();////在创建对象的时候 报JSEncrypt is not a constructor 错误 } 这个要怎么修改啊 迷糊了
引用 楼主 north55 的回复:
JSEncryptExports={}; (function(ap){var bE; var JSEncrypt=JSEncryptExports.JSEncrypt; function test(pwd) { var encrypt = new JSEncrypt();////在创建对象的时候 报JSEncrypt is not a constructor 错误 } 这个要怎么修改啊 迷糊了
JSEncryptExports={};( ap.JSEncryptJSEncrypt=a3})(JSEncryptExports); var JSEncrypt=JSEncryptExports.JSEncrypt; function test(pwd) { var encrypt = new JSEncrypt(); encrypt.setPublicKey(loginPBK); return encrypt.encrypt(pwd); }
胖多多是我 2017-03-18
  • 打赏
  • 举报
回复
JSEncryptExports={};( ap.JSEncryptJSEncrypt=a3})(JSEncryptExports); var JSEncrypt=JSEncryptExports.JSEncrypt; function test(pwd) { var encrypt = new JSEncrypt(); encrypt.setPublicKey(loginPBK); return encrypt.encrypt(pwd); }
似梦飞花 2017-03-18
  • 打赏
  • 举报
回复
JSEncryptExports={}; JSEncryptExports.JSEncrypt 这时候JSEncryptExports.JSEncrypt是undefined啊 怎么new

87,991

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧