JavaScript API
// source https://jsbin.com/zedarok
var serviceDetailsCruisesApi = (function($) {
var api = {
init: function() {
serviceDetailsCruisesApi.test();
},
test: function() {
$("body").text("Test1");
}
};
return api;
})(jQuery);
$(document).ready(function() {
serviceDetailsCruisesApi.init();
//serviceDetailsApi = serviceDetailsCruisesApi;
});
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.8.3.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var serviceDetailsCruisesApi = (function($) {
var api = {
init: function() {
serviceDetailsCruisesApi.test();
},
test: function() {
$("body").text("Test1");
}
};
return api;
})(jQuery);
$(document).ready(function() {
serviceDetailsCruisesApi.init();
//serviceDetailsApi = serviceDetailsCruisesApi;
});
</script>
<script id="jsbin-source-javascript" type="text/javascript"> var serviceDetailsCruisesApi = (function($) {
var api = {
init: function() {
serviceDetailsCruisesApi.test();
},
test: function() {
$("body").text("Test1");
}
};
return api;
})(jQuery);
$(document).ready(function() {
serviceDetailsCruisesApi.init();
//serviceDetailsApi = serviceDetailsCruisesApi;
});</script></body>
</html>