I am experiencing the following issue within Drupal but it is probably not entirely a Drupal specific issue.
I have the following simple javascript:
(function ($) {
function testing(){
alert('TEST function responding!');
}
})(jQuery);
And I am attempting to call that function from my Drupal module using the following code:
drupal_add_js('jQuery(document).ready(function () { testing(); });',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
);
However, I get an error saying Uncaught ReferenceError: testing is not defined
I want to take advantage of jQuery's abilities within that function which is why I am not using an ordinary JavaScript file.