1

Pop-ups are output at datalab but not at the colaboratory.

test = """
<script type="text/Javascript">
alert("hi")
</script>
"""
from IPython.display import HTML
HTML(test)

Is it a colaboratory bug? How can I pop up normally?
thanks

1 Answer 1

1

I don't think it's a bug. Each output is rendered in an iframe sandbox, and the sandbox doesn't have the popup capability.

A simple work-around is to use something like raw_input to prompt the user, e.g.,

value = raw_input('Enter value: ')
print 'entered', value
Sign up to request clarification or add additional context in comments.

4 Comments

I do not know what you mean. colaboratory and dataLab appear to be the same engine. But why does not it work only on a colaboratory?
Do you have a better UI design than just raw_input? For example, I want to do some interaction like multiple choices a few times. Then use those choices to calculate something.
@KorakotChaovavanich The purpose of the MNIST example is to use a layout in JavaScript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.