answer command in .irev file
Sarah Reichelt
sarah.reichelt at gmail.com
Fri Jan 15 04:30:30 EST 2010
>>> 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
More information about the use-livecode
mailing list