Функция пятнышка, т. е. сформулировать JS, который не работает

Я использую articulate.js для добавления текста в речь на сайт. код выглядит следующим образом:

<body>
<div class="articulate-area">
  <button onclick="speak('article')">Speak All</button>
  <button onclick="speak('div.intro')">Speak Intro</button>
  <button onclick="speak('div.speech')">Speak Speech</button>
  <button onclick="pause()">Pause</button>
  <button onclick="resume()">Resume</button>
</div>

<article>
  <div class="intro">
    <h1>The Gettysburg Address</h1>
    <h2>Delivered by Abraham Lincoln on November 19, 1863</h2>
    <h3>Beginning with the iconic phrase <q>Four score and seven years ago,</q> this speech is generally regarded as the most famous in American history.</h3>
  </div>

  <div class="speech">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/915932/lincoln.jpg" alt="A Portrait of the Sixteenth President">

    <p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</p>    
    <p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.</p>

  </div>
</article>
<body>
<script>
function speak(obj) {
  $(obj).articulate('speak');
};

function pause() {
  $().articulate('pause');
};

function resume() {
  $().articulate('resume');
};
</script>

Выше приведен код для добавления tts на веб-страницу, которая не работает, мне нужно добавить какой-либо другой скрипт на веб-страницу?? Официальный сайт articulate.js сообщает, что он совместим с Chrome. но я не получаю вывод речи.

1 ответ

Решение

Вы должны добавить jquery в начале https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js

Другие вопросы по тегам