S Ahmed
2012-06-30 17:32:13 UTC
So I decided doing this in my macro with regards to injecting javascript
from a page that uses the macro master.ftl:
<#macro master javascript="" >
<#nested>
<script>
$(javascript}
</script>
</#macro>
Now my page looks like:
<#import "/layout/master.ftl" as p>
<@p.master>
</@p.master>
Now how can I create a javascript varialbe to pass to the master from
within this page? Say I have this:
<#import "/layout/master.ftl" as p>
<@p.master>
function sayHello() {
alert("hello world " + "${user.name}");
};
</@p.master>
How can I create a javascript variable and assign it to the javascript
function I created?
from a page that uses the macro master.ftl:
<#macro master javascript="" >
<#nested>
<script>
$(javascript}
</script>
</#macro>
Now my page looks like:
<#import "/layout/master.ftl" as p>
<@p.master>
</@p.master>
Now how can I create a javascript varialbe to pass to the master from
within this page? Say I have this:
<#import "/layout/master.ftl" as p>
<@p.master>
function sayHello() {
alert("hello world " + "${user.name}");
};
</@p.master>
How can I create a javascript variable and assign it to the javascript
function I created?