Skip to content

Commit d0758e2

Browse files
committed
fix javascript
1 parent f5be45f commit d0758e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

static/js/javascript.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ $(document).ready(function(){
147147
$("#output").append("<pre>"+data+"</pre>");
148148
}
149149
});
150+
var exampleCode = function (id, text) {
151+
$(id).click(function (e) {
152+
//console.log("sdf");
153+
editor.setValue(text);
154+
editor.focus(); // so that F5 works, hmm
155+
});
156+
};
150157

151158
exampleCode('#codeexample1', "methods = []\nfor i in range(10):\n methodds.append(lambda x: x + i)\nprint methods[0](10)");
152159
exampleCode('#codeexample2', "for i in range(5):\n print i\n");

0 commit comments

Comments
 (0)