document.button.onclick tried to access a property on the "button" object, which returns None. You need to do "document.button.events.onclick += button_onclick" (see http://ironpython.net/browser/docs.html#event-handling-from-code).
~js > -----Original Message----- > From: [email protected] [mailto:users- > [email protected]] On Behalf Of vga vga > Sent: Tuesday, May 18, 2010 1:06 PM > To: [email protected] > Subject: [IronPython] Trying to get started with IronPython > > Hello, I'm trying to get started with web developing, I have Apache 2.2 > installed on an XP virtual machine and working for basic html. I have latest > IronPython installed and NET4. > > I've dropped the dlr-20100305.js , the xap and the 2 slvx files in my htdocs, > and my index.html contains : > > <script type="text/javascript"> > window.DLR = {path: ''} > </script> > <script src="dlr-20100305.js" type="text/javascript"> </script> > > <input id="button" type="button" value="Say, Hello!" /> <script > type="text/python"> > def button_onclick(s, e): > window.Alert("Hello from Python!") > document.button.onclick += button_onclick </script> > > On my page I see the button but also : TypeError: unsupported operand > type(s) for +=: 'NoneType' and 'function' for the last line. > > Important : I haven't configured Apache to recognize python code. I guess I > need to declare a mime type or something ? > > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
