On 12/8/05, Rune Hansen <[EMAIL PROTECTED]> wrote:
>
> I'm unable to make
> loadJSONDoc("${std.url('/Edit'/,rand="+Math.random()+"tg_format='json')}")
> work. KID obviously frowns upon gluing together a template function.
>
As Bob said, this won't work. However, loadJSONDoc takes a dict as
it's optional second argument. Why not use that as Bob did in his
example?
So the above line would become:
loadJSONDoc("${std.url('/Edit/')}", {"rand": Math.random(),
"tg_format": "json"});
Even better would be to have a hidden input in your template so
std.url isn't used to generate JavaScript:
<input type="hidden" id="jsonurl" value="std.url('/Edit')"/>
Then have:
loadJSONDoc(getElement("jsonurl").value, {"rand": Math.random(),
"tg_format": "json"});
Note that this was written in gmail and may need some work.
Lee