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 |
module browser.websocketWeb sockets, defined in HTML5, are a way to handle bi directional communication between client and server The module defines a boolean:supported
indicates if the protocol is supported by the browserand a function: WebSocket( host)
host is the location of a server that supports the WebSocket protocol. Returns a WebSocket objects have the following methods :
bind( evt,function)
attaches the function to the event evt. The events and the corresponding function arguments are :
send( data)
sends the string data to the server close()
closes the connectionExample :
|