python method inaccessible from javascript

With Internet Explorer 9 on Widows, I can’t access to python method from Javascript whereas the access to python attribute works well.

What I tried :
In my python file: = "x"
base.appRunner.main.resize = self.resize

def resize(self):
  print "bla"

In my javascript file:

var plugin = document.getElementById("myPlugin");
alert("name : ";
alert("method : "+plugin.main.resize());

The results are :
name : x
method : undefined

Does someone has an idea ?

PS : With the same syntax, It works well on many browsers like Firefox, Chrome.

Your method doesn’t return anything, so I would expect the result to be “undefined”. Does it work if you return something else, such as 2 or so?

No it doesn’t work even if my method returns something, the result is the same…

Can you post a complete (but simple) example demonstrating the problem?


Here, the code of my python class :

class World(DirectObject):
  def __init__(self): = x = 
    base.appRunner.main.myTest = self.myTest
    smiley =   base.appRunner.dom.document.getElementById('smiley')
    print "smiley ",smiley
  def myTest(self):
    print "myTest"
    return 2

Now, my php page where I declare the object plugin

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
    <title>Test Panda3d</title>
    <script type="text/javascript"  src="js/RunPanda3D.js"></script>
    P3D_RunContent('data', '', 'id', 'scripty',
               'width', '300', 'height', '300',
               'auto_start', '1')
    <div id="smiley">^_^</div>
    <input type="button" value="fire" onclick="fire3()" />

    <script type="text/javascript">
        function fire3() {
            var plugin = document.getElementById('scripty');
            if (plugin.main!=null) 
                res = plugin.main.myTest();
                alert("Result : "+res);
                alert("Name : ";

With IE9, the results are :
Result : undefined
Name : xIn the p3dSession.log :
smiley [object HTMLDivElement]
The link from python to Javascipt works but not from Javascript to python

With another browser like Firefox, the results are :
Result : 2
Name : xIn the p3dSession.log :
smiley [object HTMLDivElement]