I am including a js file via the layout xml:
for example:
<reference name="head">
<action method="addItem">
<type>js</type>
<name>myjs.js</name>
</action>
</reference>
This is fine. But, i am setting up an ajax call inside myjs.js and would like to pull the post url from a helper class.
How would this be possible?
Inside your reference to the
headI would add a block which would output a partial that sets a js var ahead of the myjs.js file being added.For instance:
And your file mycustomblock.phtml would contain: