Guest User

Untitled

a guest
Jan 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <input type="text" value="{"id":"1","price":"30.00","edit":0},
  2. {"id":"2","price":"8.00","edit":0}" id="json" />
  3.  
  4. **code:**
  5. var json = $('#json').val().split(',');
  6.  
  7. for (var i = 0; i < json.length; i++){
  8. alert(json);
  9. }
  10. //(seems its splitting every comma it finds).
  11.  
  12. $.parseJSON("[" + $('#json').val() + "]");
  13.  
  14. <input type="text" value='{"id":"1","price":"30.00","edit":0},
  15. {"id":"2","price":"8.00","edit":0}' id="json" />
  16.  
  17. <input type="text" value='{"id":"1","price":"30.00","edit":0},{"id":"2","price":"8.00","edit":0}' id="json" />
  18.  
  19. value='{"id":"1","price":"30.00","edit":0}, {"id":"2","price":"8.00","edit":0}'
Add Comment
Please, Sign In to add comment