Hi,

I would like to run python function from javascript on existing webpage.

Yes, I know, that it's not the most desired way of using pyjamas, but 
well, I cannot migrate whole website to pyjamas, but I need to write 
widget which I'd like to write in pyjamas.

So far, I'm doing it in such way:

window.frames[0].$pyjs.loaded_modules.all.my_function()

which calls my_function from all.py

I have feeling that I'm doing it wrong, and I'm sure that it's very 
unelegant. Is there better way to do it (searched documentation, but 
nothing about it).

I'm lucky that I'm pretty sure that there are no more iframes in 
webpage. However, it can change in future, and frames[0] can be some 
other iframe, not my "all" module iframe.

How would you do it, if you had such need?

-- 
pozdrawiam

Ɓukasz Mach
Pagema (http://www.pagema.net)

Reply via email to