[ic] Scripting inside IC Tags
Frank
interchange-users@icdevgroup.org
Thu Sep 19 19:03:00 2002
Hello List,
after getting caught in the mailinglist-archives without result
here now my as I think simple question:
I want to randomize a loop search within a page every time the page
will be refreshed. So I only have to change the search-value
(5 possible values a-e) within the loop-search.
I tried the following:
1. perl version
[loop search="se=
[perl interpolate=1]
@tmp = (a,b,c,d,e)
srand();
$num = int(rand 5);
$out = $tmp[$num];
$out;
[/perl]
/sf=cat/ml=1"]
--> nothing happens, even with generating the hole [loop search....]
by the script -> no output (seems to me the rand function
is not supported.(?))
2. javascript version
[loop search="se=
<SCRIPT LANGUAGE="JavaScript">
var what = new Array("a",
"b",
"c",
"d",
"e");
var znum = Math.floor((Math.random()*what.length));
out = what[znum];
document.write (out);
</SCRIPT>
/sf=cat/ml=1"]
--> [loop search.....] shows up right, but is not parsed or 'executed'
by Interchange.
So, what can I do to make a IC tag run even with a piece of code inside?
ThanX for any ideas,
Frank