Board Logo

Problem using javascript in tree
axelsegers - 6/6/2006 at 02:49 AM

I got a javascript error when using the following example

var TREE_ITEMS=[['my-test',0,null,['vlucht reserveren', "javascript:openTrxHkt('NCR$01','Dzb01','01');"],['nieuwe vlucht',"javascript:openTrxHkt('NCR$02','Dzb01','02');"],]];

Howerver the menu is visually Ok, and the script 'openTrxHkt' is launched and working correctly i got a javascript error by loading the tree : Error ';' expected

I don't get the error when using
var TREE_ITEMS=[['my-test',0,null,['vlucht reserveren', "javascript:openTrxHkt(NCR$01,Dzb01,01);"],['nieuwe vlucht',"javascript:openTrxHkt(NCR$02,Dzb01,02);"],]]; ,
but in that case my javascript function 'openTrxHkt' fails on the first param.

Any idea how i can solve this?
Thanks a lot !

axelsegers - 6/7/2006 at 08:36 AM

anyone an idea?


axelsegers - 6/9/2006 at 06:02 AM

The example below works and shows an alert when clicking on the item 'overview', however i also got a javascript error ';' expected, did anyone got similar problems ? is javascript working for Tigra menu pro ?

var TREE_ITEMS=[['beheer',null,null,['overview', "javascript:alert('test');"],]];
var NAV_TREE = new tree (TREE_ITEMS, TREE_TPL,'testtree');

tigra - 6/9/2006 at 09:17 AM

avoid the commas in front of the closing brackets. Last element of the list should not have the comma after it.

axelsegers - 6/12/2006 at 02:26 AM

I tried with

var TREE_ITEMS=[['beheer',null,null,['overview', "javascript:alert('test');"]]];

and this still results in the same error : ';' expected.

tigra - 6/12/2006 at 06:27 PM

I tried that with Tigra Tree Menu PRO and it worked just fine. Make sure you set target to '_self' in tree_tpl.js

Back to forum: