how to set a variable inside a page that uses a macro?
S Ahmed <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <CAG2rwuM6_ow6x34=JpkKxCsk5XU6Q3GktRWQ4pCPuY1b=41oRQ@mail.gmail.com> |
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?
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user