awacke1 commited on
Commit
654825b
·
verified ·
1 Parent(s): 08c24f3

Update mycomponent/index.html

Browse files
Files changed (1) hide show
  1. mycomponent/index.html +8 -0
mycomponent/index.html CHANGED
@@ -185,6 +185,7 @@
185
  // Now modify this part of the code to fit your needs:
186
 
187
  var myInput = document.getElementById("myinput");
 
188
 
189
  // data is any JSON-serializable value you sent from Python,
190
  // and it's already deserialized for you.
@@ -199,6 +200,13 @@
199
  dataType: "json",
200
  });
201
  })
 
 
 
 
 
 
 
202
 
203
  // Hook things up!
204
  window.addEventListener("message", onDataFromPython);
 
185
  // Now modify this part of the code to fit your needs:
186
 
187
  var myInput = document.getElementById("myinput");
188
+ var myOutput = document.getElementById("output");
189
 
190
  // data is any JSON-serializable value you sent from Python,
191
  // and it's already deserialized for you.
 
200
  dataType: "json",
201
  });
202
  })
203
+
204
+ myOutput.addEventListener("change", function() {
205
+ sendDataToPython({
206
+ value: myOutput.value,
207
+ dataType: "json",
208
+ });
209
+ })
210
 
211
  // Hook things up!
212
  window.addEventListener("message", onDataFromPython);