summaryrefslogtreecommitdiff
path: root/static/website/js/cloud.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/website/js/cloud.js')
-rw-r--r--static/website/js/cloud.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js
index 644d7fd..6b56606 100644
--- a/static/website/js/cloud.js
+++ b/static/website/js/cloud.js
@@ -84,6 +84,20 @@ $(document).ready(function() {
});
});
+ $(document).on("change", "#examples", function(){
+ $.ajax({
+ url: "/ajax-code/",
+ type: "POST",
+ data: {
+ example_id: $("#examples").val()
+ },
+ dataType: "html",
+ success: function(data) {
+ editor.setValue(data);
+ }
+ });
+ });
+
/* Execute the code */
$("#execute").click(function() {
var csrfmiddlewaretoken = $("[name='csrfmiddlewaretoken']").val();