javascript: asigning variable from JS to EZ

Author Message

Jorge estévez

Monday 12 May 2008 12:23:36 pm

Hi!

Assume the following piece of code (I have truncated the original code), what I would like to do is to add to the EZ variable $mynodo the value of the JS variable nodeID.

How can this be done?

take into consideration that If I use something like:

$mynodo={literal}nodeID{/literal}

It will not work, instead it will print out the text "nodeID" within the JS code.

I have read in the forum several forum discussions about asigning an Ez variable to a javascript (using LITERAL), but this is the opposite, a JS variable to an EZ variable....

{literal}
<script language="JavaScript" type="text/javascript">
function MyOnNodeOpen (nodeID, state)
{
	{/literal}
	{def $my_node = array()
         $mynodo=XXXXXX
	}
        {literal}
}
</script>
</literal>

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Łukasz Serwatka

Monday 12 May 2008 11:31:11 pm

Hi,

You can't assign JS variable to template variable. JS is client side technology. It will always run after the template code is executed.

Perhaps you can describe better what you want to do?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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