IntroductionInstallationLimitations of the "file" protocolFrequently asked questionsSyntax, keywords and built-in functionsStandard distributionimport implementationBrython packagesBrowser interface
Introduction - DOM API
Creating a document Accessing elements Attributes, properties and methods Events Mouse events Keyboard events Focus events Drag events Query string Interactions with Javascript Brython-specific built-in modules
browser
browser.aio browser.ajax browser.html browser.local_storage browser.markdown browser.object_storage browser.session_storage browser.svg browser.template browser.timer browser.webcomponent browser.websocket browser.worker Widgets browser.widgets.dialog browser.widgets.menu interpreter javascript Working with BrythonCookbook |
IntroductionFor the interface with the browser, Brython is compliant with the Document Object Model interface, which is widely documented on the web : This interface is language-independent. With Brython, all the operations described in the DOM API rely on two objects defined in the module browser : document and window document implements the interfaceDocument defined in the DOM API. For instance, it supports the following methods :
document.getElementById(elt_id)
returns a reference to the DOM element whose id is elt_id document.createElement(tagName)
returns a new element of type tagName ; for instance, to create an hypertext link : link = document.createElement('A') document.appendChild(elt)
add the element elt to the documentBesides this standard interface, Brython propose an alternative interface, more familiar for Brython developers. It is described in the following pages |