answer command in .irev file

Martin Baxter mb.userev at harbourhosting.co.uk
Fri Jan 15 04:21:46 EST 2010


Sarah Reichelt wrote:
> 2010/1/15 Tim Selander <selander at tkf.att.ne.jp>:
>> More playing with scripting .irev/html files.
>>
>> Is there any way to put up an answer dialog? I have a variety of
>> small text files I'd like to pop up over the main page to give
>> the user extra information....
> 
> 
> Here is an On-Rev command that I use to create a JavaScript dialog,
> similar to an answer dialog:
> 
> command doAlert tData
>    put "<script type=" & quote & "text/javascript" & quote into tJScommand
>    put ">alert('" & tData & "')</script>" after tJScommand
> 
>    put tJScommand
> end doAlert
> 
> 
> Use it like this:
> 
> doAlert "This is just like an answer dialog."

Just a word of caution. Be aware that not all web clients are able to
raise a javascript alert. The iphone for instance just fails silently I
gather - because it's a single window environment. I would recommend
using javascript/css to hide and show these texts rather than javascript
alerts.

Martin Baxter



More information about the use-livecode mailing list