Board Logo

Making an alert() or a custom function instead of a link ?
julienM - 8/29/2008 at 10:47 AM

Hello !

I bought tigra tree menu pro several weeks ago and by now i've only used it by making copy/past from the demos :)

But now i have to do something more specific and even if i know that it should be simple, i can't figure how to do it.

So my problem: i just want to call an alert() or a simple custom js function instead of calling a link.

something like this:

var TREE_ITEMS = [
['root', '', {'st':1},
['folderA', 'javascript:onclick=alert('test')', {'tt':'folder A'},
['file 1', '', {'tt':'file 1'}],
['file 2', '', {'tt':'file 2'}]
],
['folderB', '', {'tt':''}]
]
];


Thank you for helping me,

Julien.


tigra - 10/6/2008 at 07:54 PM

['folderA', 'javascript:alert('test')', {'tt':'folder A'},

note the slashes in front of apostrophes. You already use them for terminating the string so you need to escape them inside the string. Another way is: "javascript:alert('test')"


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/