SHARE
TWEET

Untitled

a guest Aug 20th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function json() {
  2.   vToArr();
  3.   var str = JSON.stringify(json_training);
  4.   myJSON = str;
  5. }
  6.  
  7. function vToArr(){
  8.   for(var a = 0; a <= x; a++){
  9.     json_training[y] = {};
  10.     var arrExercise = document.getElementsByClassName('exercise')[counter].value;
  11.     if(arrExercise != ""){json_training[y]["uebung"] = arrExercise;}else{json_training[y]["uebung"] = "-";};
  12.     var arrDevice = document.getElementsByClassName('device')[counter].value;
  13.     if(arrDevice != "hidden"){json_training[y]["geraet"] = arrDevice;}else{json_training[y]["geraet"] = "-";}
  14.     var arrWeigth = document.getElementsByClassName('weigthValue')[counter].value;
  15.     json_training[y]["gewicht"] = arrWeigth;
  16.     var arrRepeat = document.getElementsByClassName('repeatsValue')[counter].value;
  17.     json_training[y]["wiederholungen"] = arrRepeat;
  18.     y++;
  19.     counter = [y];
  20.   }
  21.   y = 0;
  22.   counter = [0];
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top