Safely access js attributes #2455
Replies: 1 comment
-
In Brython code, use Python's from browser import window
print(getattr(window.SOME_GLOBAL, 'a', None)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to access js values in global objects on window, safely
When I tried that, I got the error
AttributeError: 'Javascript Object' object has no attribute 'get'
How can we use objects on global window and safely access it like with
dict
get
method? including on thewindow
itself.Beta Was this translation helpful? Give feedback.
All reactions