def GET(self, word): # web.py server which allow cross-site xmlhttprequest # https://gist.github.com/1271118/52eca29d23a1f307597e04d434b0421011843e2f #web.header('Access-Control-Allow-Origin', '*') #web.header('Access-Control-Allow-Credentials', 'true') if type(word) is not unicode: word = word.decode('utf-8') return getWordJson(word)
def getWordHtml(prefix, word): template = jj2env.get_template('word2.html') return template.render({'bookExps': json.loads(getWordJson(word)), 'booksIndex': dicIndex, 'word': word})