我的浏览器(Chrome)出现以下错误:
Uncaught TypeError: Object [object global] has no method 'mixIn' aes.js:28
d.CipherParams.l.extend.init aes.js:28
c.hasOwnProperty.c.init sha1.js:7
e jQuery.js:7
Wc jQuery.js:7
Wc jQuery.js:7
n.param jQuery.js:7
n.extend.ajax jQuery.js:7
saveCurrentNote (index):88
selectNote (index):97
(anonymous function) (index):125
n.event.dispatch jQuery.js:6
r.handle
这是源代码:
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/jQuery.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/cryptojs/rollups/sha1.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/cryptojs/rollups/aes.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/cryptojs/rollups/pbkdf2.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/cryptojs/rollups/sha3.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/Basic.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl ?>/js/Auth.js"></script>
在 Basic.js 中:
function encrypt(data, key) {
return CryptoJS.AES.encrypt(data, key);
}
function decrypt(data, key) {
return CryptoJS.AES.decrypt(data, key);
}
以及这些函数的用法:
data["name"] = encrypt(data["name"], recall("key"));
data["text"] = encrypt(data["text"], recall("key"));
这是 CryptoJS 库的链接:https ://code.google.com/p/crypto-js/
有什么我没有做的吗?