answer command in .irev file

Martin Baxter mb.userev at harbourhosting.co.uk
Fri Jan 15 09:38:44 EST 2010


Sarah Reichelt wrote:
>>>> 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.
> 
> 
> This script works perfectly on the iPhone, opening a dialog box just
> like all iPhone alerts, but I agree that one should not depend on
> JavaScript being enabled.
> 
> Cheers,
> Sarah

Thanks for clarifying that Sarah, it failed in my tests failed when I
checked that, but admittedly that was a while ago now.

Martin Baxter



More information about the use-livecode mailing list