data = ""
global element
from __pyjamas__ import doc
def escape(s):
s = s.replace("&", "&")
s = s.replace("<", "<")
s = s.replace(">", ">")
s = s.replace('"', """)
return s
def display_log_output():
global element
global data
element = doc().createElement("div")
doc().body.appendChild(element)
element.innerHTML = data
def write(text, do_escape=True):
global data
if do_escape:
text = escape(text)
data += text
print "data", data
def writebr(text, do_escape=True):
write(text + "<br />\n", do_escape)
|