1.本身和引用了才能调用
var CommentMenthod;
if(!CommentMenthod){
CommentMenthod={};
}
CommentMenthod={
changeIPMode:function(iType) {
alert(iType);
}
}
$(function(){
CommentMenthod.changeIPMode(12345);
})
2.只有本身可以调用
(function () {
function init() {
}
function changeIPMode(iType) {
alert("切换事件");
}
$(init());
})()
3.需要JS开放才能调用
var lliulol = (function () {
function changeIPMode(iType) {
alert("切换事件");
}
return {
changeIPMode: changeIPMode
}
} ())
4.本身和引用了才能调用(采用seajs加载)
define(function (require, exports, module) {
ParkBlockCreate = {
InitPopup: function (currOrgData) {},
}
module.exports = ParkBlockCreate;
})
require.async(["ParkBlockCreate.js"], function (BrandManage) {
BrandManage.InitPopup();
});
5.跟随页面(采用seajs加载)
<script>
seajs.use("/MonitorCenter/VideoCenter/VidoPlayBack", function (main) {
main.initial();
});
</script>
define(function (require, exports, module) {
var VideoPlayBack = (function () {
function initial() {
}
return {
initial: initial
}
} ())
module.exports = VideoPlayBack;
})
6.开放才能调用(采用seajs加载)
var MonitorDevice = require("/MonitorCenter/MonitorDevice.js");
define(function (require, exports, module) {
var MonitorDevice = (function () {
function ShowRefreshDevice(){
}
return {
ShowRefreshDevice: ShowRefreshDevice
}
} ())
module.exports = MonitorDevice;
})