fork download
  1. $('#jsAddAddress').on('click', function() {
  2. $('input[name="UF_ADDRESS[]"]').suggestions().dispose();
  3.  
  4. var address = $(this).prev().find('.form__item:last').clone(true).addClass('--clone');
  5. if (!location.pathname.includes('create-notification')){
  6. address.find('.form__input').val('');
  7. }
  8. $(this).prev().find('.form__item:last').after(address);
  9.  
  10. //reinit
  11. $('input[name="UF_ADDRESS[]"]').suggestions({
  12. token: 'token',
  13. type: "ADDRESS",
  14. /* Вызывается, когда пользователь выбирает одну из подсказок */
  15. onSelect: function(suggestion) {
  16. console.log(suggestion);
  17. }
  18. });
  19.  
  20. return false;
  21. });
Runtime error #stdin #stdout #stderr 0.02s 16872KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:1:1 ReferenceError: $ is not defined
Stack:
  @prog.js:1:1