jquery - "Uncaught SyntaxError: Unexpected token (". Syntax looks good to me -
jquery - "Uncaught SyntaxError: Unexpected token (". Syntax looks good to me -
console outputs "unexpected token {" on if(message.indexof.("how you")>=0){
line.
function send_message(message){ var prevstate = $("#container").html(); if (prevstate.length > 3){ prevstate = prevstate + "<br>"; } $("#container").html(prevstate + "<span class='current_msg'> + '<span class = 'bot'>chatbot: </span>' + message</span>"); $(".current_msg").hide(); $(".current_msg").delay(slow).fadein(); $(".current_msg").removeclass("current_msg"); } var="username"; function ai(message){ if (username.length<3){ /*checks see if var empty*/ username = message; send_message("nice meet " + username + ", how doing?"); } if(message.indexof.("how you")>=0){ /*error here*/ send_message("me's good"); } if(message.indexof.("time")>=0){ var date = new date(); var h = date.gethours(); var m = date.getminutes(); send_message("time: " + h + ":" + m); } }
on if(message.indexof.("how you")>=0){ /*error here*/
row have dot after indexof
. same error on if(message.indexof.("time")>=0){
jquery
Comments
Post a Comment