Application Helper and Javascript


#1

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 ?


#2

Why not just include the javascript file in the tag? Can you post
the code you are using?

-Jonny.

Dylan S. 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 ?


#3

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 :slight_smile:


#4

It happens to all of us :wink:

-Jonny.

Dylan S. 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 :slight_smile: