[NTG-context] Acrobat JavaScript in ConTeXt

Vedran Miletić rivanvx at gmail.com
Wed Mar 9 19:06:16 CET 2011


Dana 8. ožujka 2011. 00:29 Hans Hagen <pragma at wxs.nl> je napisao/la:

> On 7-3-2011 5:11, Vedran Miletić wrote:
>
>> Hi,
>>
>> how can one make a button that does app.alert() in ConTeXt? I tried
>> something like this without much luck:
>>
>> \setupinteraction[state=start]
>>
>> \starttext
>> \goto{Button}[JS(app.alert{Hello World})]
>> \stoptext
>>
>> Can anyone help?
>>
>
> \startJSpreamble MyStuff used later
>
> function MyAlert(str) {
>  app.alert(str)
> }
>
> \stopJSpreamble
>
> \goto{Button}[JS(MyAlert{Hello World})]
>
> so, we have a separation between definitions and usage.
>

Thanks, it works!

I have two further questions:
1) how to deal with commas in strings? MyAlert{Hello, World} displays only
Hello.
2) is it possible to get international charcters (such as čćžšđ) in strings?

Regars,

Vedran Miletić
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20110309/f01e0530/attachment.html>


More information about the ntg-context mailing list