Forums / Setup & design / using Javascript with eZ / Comment23719
Betsy Gamrat
Tuesday 09 January 2007 8:38:37 pm
Claudia,
I would recommend adding an init or config function in the external js file. That function would be called by script code in pagelayout.tpl that would set the variables you need.
Good luck,
Betsy
For example:
<b>pagelayout.tpl</b>
<script src="{'ajax.js'|ezdesign}"></script> <script>init_ajax('{$node.url_alias|ezurl}',30)</script>
<b>ajax.js</b>
target_url='' timeout=0 function init_ajax(in_url,timelimit) { target_url=in_url timeout=timelimit } function do_ajax() { sendRequest(target_url) /* Sample code, may not be correct syntax/call */ }