using Javascript with eZ

using Javascript with eZ

Friday 05 January 2007 3:46:58 am - 1 reply

Author Message

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 */
}

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.