Is there a free prompt?

82 views Asked by At

I am learning JavaScript (via Eloquent JavaScript) and thought I would learn Websharper at the same time.

Is there access to JavaScript's prompt command outside of ExtJS?

I searched online and couldn't find anything in the documentation that didn't require a license.

1

There are 1 answers

2
Tarmil On BEST ANSWER

It is indeed missing in the WebSharper API. I filed a bug report and we should add it soon. In the meantime, you can define it as follows:

[<Inline "prompt($question, $defaultResponse)">]
let Prompt (question: string) (defaultResponse: string) = null : string

[Edit: added types for the arguments]