Re: [jQuery] Calling function in jQuery

2009-11-09 Thread Murali Krishna B
Hi all, Now I am able to call jQuery functions from other blocks. Please help me in solving this one also. I have a form with select option. It will be populated dynamically after every ajax request. In form, I have a select tag with no options. After getting a content from ajax, I am prepa

Re: [jQuery] Calling function in jQuery

2009-11-09 Thread Dhruva Sagar
The function by itself will not be available within other blocks, since the function is in local scope. You should attach the function to the jQuery object instead for later use using the following syntax : (function($) { $.function_name = function test() { alert('in function'); } })(jQue

[jQuery] Calling function in jQuery

2009-11-09 Thread Murali Krishna B
Hi all, I am creating a function using jQuery in application.js file. (function($) { function test() { alert('in function'); } })(jQuery); When I am trying to call this function from outside (not in this jQuery block), I am getting an error saying that function is not defined. I am incl