isEqual() undefind是什么情况啊,我按照老师个代码敲的
html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript" src="js/require.js" data-main="js/main"></script>
</body>
</html>
main.js:
requirejs.config({
paths:{
jquery:'jquery.min'
}
});
requirejs(['jquery','validate'],function($,validate){
console.log(validate.isEqual(1,2));
});
validate.js:
define(['jquery',function($){
return{
isEmpty:function(){},
checkLength:function(){alert("11");},
isEqual:function(str1,str2){
return str1===str2;
}
};
}]);