It might be that safari buffers the event to render the query, but
immediately executes a prompt() call. I'm not sure if that would be a bug
or not. You might need to just do it asynchronously, using
emscripten_call_async etc.

- Alon


On Sun, Oct 26, 2014 at 3:49 AM, Anton Smirnov <d...@antonsmirnov.name>
wrote:

> Few topics ago i've asked similar question
> <https://groups.google.com/forum/#!topic/emscripten-discuss/ilSnBNrd2kY>
> and i was answered that printf needs '\n' or fflush() to force output. That
> works great in Google chrome but unfortunately does not work in Safari
> (which is default browser and widely used on mac). How can i force output
> or workaround it (i agree it can be Safari's bug/feature though)?
>
> Full story:
>
> #include <iostream>
>
>
> using namespace std;
>
>
> int main() {
>     char name[128];
>     cout << "type your name:\n";
>     cin.getline(name, sizeof(name));
>     cout << "hi, " << name << endl;
>
>
>     return 0;
> }
>
>
> In Safari input box is shown before "type your name" is printed:
>
>
> <https://lh5.googleusercontent.com/-KT3eWAPE1ZE/VEzRNE6E86I/AAAAAAAABAA/qaBhNWD33jA/s1600/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%2B%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%2B2014-10-26%2B%D0%B2%2B16.43.18.png>
>
> I've try fflush(stdout) too, but unfortunately it does not help.
>
> After text input done cout works as expected:
>
> type your name: *(input dialog shown and 'Anton' is typed)*
>
> hi, Anton
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to