J
J
jackie chan2015-11-11 19:57:02
JavaScript
jackie chan, 2015-11-11 19:57:02

Vk is not defined why?

Hello everyone) Help me pliz, otherwise I don’t even get stuck, I’m a beginner in business)
There is such a script js js

<script type="text/javascript">
  function recommendate(){
    vk.api.call('audio.getRecommendations', {}, function(r) {
      if(r.response) {
        $('#playlist').append('<li><a href="<?= $item['url'] ?>"><b><?= $item['artist'] ?></b> - <?= $item['title'] ?> <span class="label"><?= $item['aid'] ?></span></a></li>')
      }
    });
  };
</script>

calling like this
<a href="javascript:recommendate();" class="sm2-inline-button menu">menu</a>

In the console I get this: Uncaught ReferenceError: vk is not defined
Cant I understand in the script itself, but I can’t even catch up

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-11-11
@onvorobyov

Because VK

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question