JSFiddle - React, Tailwind, and code Playground
by Vaishak
HTML
<script type="text/javascript">
document.write("Type of fun 1 is: " + typeof(fun1));
document.write("<br />");
document.write("Type of fun 2 is: " + typeof(fun2));
document.write("<br />");
document.write("Type of includedFun is: " + typeof(includedFun));
document.write("<br />");
document.write("Type of includedFunJqReady is: " + typeof(includedFunJqReady));
</script>
JavaScript
/* This is a plugin code, included as script src */
(function($) {
$.fn.includedFunJqReady = function() {
console.log("You are in includedFunJqReady");
}
}(jQuery));
/* EO plugin code */
/* JS in page */
function fun1() {
console.log('fun');
function fun2() {
console.log('fun 2');
}
}
jQuery(document).ready(function(){
console.log("Type of includedFunJqReady is: " + typeof(includedFunJqReady));
$('body').includedFunJqReady();
});