bugfix #169, change writeJavascript to delegate evalJs