ReferenceError: select is not defined

I am following the chatbot tutorials but I am getting this error, ReferenceError: select is not defined.Screen Shot 2017-10-25 at 12.28.10 PM

Here is my code: HTML:

<!DOCTYPE html> Chatbot

CHATBOT

say: SUBMIT

reply:

JAVASCRIPT

let num = 37555;

function setup(){ noCanvas(); let button = select('#submit'); let user_input = select('#user_input'); let output = select('#output');

button.mousePressed(chat);

function chat(){
    let input = user_input.value();
    output.html(input);
    console.log ("check");

}

}

Answers

  • edited October 2017

    Your "index.html" isn't correct: :-S
    P.S.: I had to copy it by selecting Edit on your post btW, b/c it's not showing up! ^#(^

    <script type=https://CDNjs.CloudFlare.com/ajax/libs/p5.js/0.5.16/addons/p5.dom.js></script>
    <script src=https://CDNjs.CloudFlare.com/ajax/libs/p5.js/0.5.16/p5.js></script>
    <script src=sketch.js></script>
    
    • You're using type= instead of src= for loading "p5.dom.js"! #-o
    • Also, you're attempting to load "p5.dom.js" before "p5.js".
    • However, "p5.dom.js" depends on "p5.js", so the order they're loaded is highly important! L-)
    • Noticed as well you're using scheme "file://". You should then visit this site below: :-B
      http://Chrome-allow-file-access-from-file.com/
  • Here's a very minimum "index.html" template: O:-)

    <script defer src=https://CDN.JSDelivr.net/npm/p5></script>
    <script defer src=https://CDN.JSDelivr.net/npm/p5/lib/addons/p5.dom.min.js></script>
    <script defer src=sketch.js></script>
    
Sign In or Register to comment.