I have a "javascript_include_tag" including a Javascript function. I have a function being invoked via a helper in the same view, which prints out a script tag that uses the javascript function above. Problem is, the function being invoked via the helper can''t find the javascript function included in the "javascript_include_tag". I hardcoded the javascript that exists in the "javascript_include_tag", into the head of the view... and the helper had no problem finding the method. So... it seems that the helper is being invoked before the "javascript_include_tag" declaration ? Does this seem correct ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060125/7a018529/attachment.html
Why not just include the javascript file in the <head> tag? Can you post the code you are using? -Jonny. Dylan Stamat wrote:> I have a "javascript_include_tag" including a Javascript function. > I have a function being invoked via a helper in the same view, which > prints > out a script tag that uses the javascript function above. > > Problem is, the function being invoked via the helper can''t find the > javascript function included in the "javascript_include_tag". > > I hardcoded the javascript that exists in the "javascript_include_tag", > into > the head of the view... and the helper had no problem finding the > method. > So... it seems that the helper is being invoked before the > "javascript_include_tag" declaration ? > > Does this seem correct ?-- Posted via http://www.ruby-forum.com/.
Jonathan... SVN problem, and my Javascript wasn''t updated. It all works now. One sec.... going to go bury my head in the sand real quick :) On 1/25/06, Jonathan Viney <jviney@spreydon.org.nz > wrote:> > Why not just include the javascript file in the <head> tag? Can you post > the code you are using? > > -Jonny. > > Dylan Stamat wrote: > > I have a "javascript_include_tag" including a Javascript function. > > I have a function being invoked via a helper in the same view, which > > prints > > out a script tag that uses the javascript function above. > > > > Problem is, the function being invoked via the helper can''t find the > > javascript function included in the "javascript_include_tag". > > > > I hardcoded the javascript that exists in the "javascript_include_tag", > > into > > the head of the view... and the helper had no problem finding the > > method. > > So... it seems that the helper is being invoked before the > > "javascript_include_tag" declaration ? > > > > Does this seem correct ? > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060125/bf9e37ee/attachment.html
It happens to all of us ;) -Jonny. Dylan Stamat wrote:> Jonathan... SVN problem, and my Javascript wasn''t updated. It all works > now. > One sec.... going to go bury my head in the sand real quick :)-- Posted via http://www.ruby-forum.com/.