fork download
  1. let variants = getVariants();
  2. console.log(variants);
  3.  
  4. function getVariants() {
  5. $.ajax({
  6. url: 'index.php?route=catalog/attribute/getAJAXvariants&token=<?php echo $token; ?>',
  7. type: 'GET',
  8. success: function(json) {
  9. return JSON.parse(json)
  10. },
  11. error: function(thrownError){
  12. alert('При передаче данных произошла ошибка!');
  13. console.log(thrownError);
  14. }
  15. });
  16. }
Runtime error #stdin #stdout #stderr 0.04s 16856KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:5:3 ReferenceError: $ is not defined
Stack:
  getVariants@prog.js:5:3
  @prog.js:1:16