i have make two global function now i want to call them in my HTML page. i have make separate file for global function and calling them it into our HTML page but it seems that something wrong with my code
<script type="text/javascript">
(function ($) {
jQuery.functionOne = function () {
var text = "i am first"
};
jQuery.functionTwo = function (param) {
var text = "i am second"
};
})(jQuery);
$('.first').text().functionOne();
$('.second').text().functionTwo();
</script>
<body>
<div class="first"></div>
<div class="second"></div>
</body>
Try this please: If you are calling these functions within text function then try like the code below: Demo http://jsfiddle.net/SMLTP/ or http://jsfiddle.net/SMLTP/1/
Update demo according to your updated code: http://jsfiddle.net/SMLTP/8/
If you keen: http://api.jquery.com/text/
Hope this helps or please lemme know if I missed anything!
:)sample function =>
Update