(index):61 Uncaught ReferenceError: fnspeak1 is not defined
(index):61 Uncaught ReferenceError: fnspeak1 is not defined
我已经创建了一个文本到语音程序..我得到一个错误消息,这是下面给出的这是我的程序。
Html<textarea id="message"></textarea>
<button type="button" onclick="fnspeak1()">
Play
</button>
Js
function fnspeak1()
{
var msg = new SpeechSynthesisUtterance(document.getElementById("message").value);
window.speechSynthesis.speak(msg);
}
然而,当运行…,当播放按钮被点击:我得到这样的错误信息:
Uncaught ReferenceError: fnspeak1 is not defined
有人能帮我一下吗?提前谢谢Ps:我是js的初学者
我想你应该多打些代码给我分析。
-
add window.onload = fnspeak1(){ your js code }
或Jquery$(document).ready( your funciton here )
-
你的职能在其他行动下吗?例如:
$(".a").on('click',function(){ your function })
-
如果你的html和js不在一个页面中,你是否以正确的方式包含js ?
相关文章:
- Is onfling available for html, html5
- jQuery is not loaded
- reactRedux is not defined
- ReferenceError: cordova is not defined @ng-cordova.min.js:7
- Jquery - table.row(tr) is undefined
- contentWindow.document.body is null
- Tomcat websocket is not working
- noty.js is returning undefined
- $routeParams is undefined
- NodeJS Multer is not working
- React, Webpack: bundle.js is not generated
- jQuery is not defined - WordPress footer.php
- 谷歌地图API v3:Initial View is Fine,but Gray Box with No Map if
- imageArray[i] = imageItem is incompatible
- GAPI Is Not Defined
- Angular2 rc1, where is shims_for_IE
- Is (!~index) faster than (index === -1)?
- Mouse Out Orange Div "CurrentHeight" is not applyi
- Is jquery's attr() asynchronous?
- (index):61 Uncaught ReferenceError: fnspeak1 is not defined