Skip to content

Instantly share code, notes, and snippets.

@nus
Created April 28, 2011 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nus/946114 to your computer and use it in GitHub Desktop.
Save nus/946114 to your computer and use it in GitHub Desktop.
音声入力APIのテスト。イベント検知ができた
<html>
<head>
<meta charset="utf-8">
<title>x-webkit-speech test</title>
<script>
function onchange() {
alert("changed");
}
</script>
</head>
<body>
<input type="text" x-webkit-speech />
<script>
document.getElementsByTagName("input")[0].onwebkitspeechchange=onchange;
/*
<input type="text" x-webkit-speech onwebkitspeechchange="onchange();" />
としたいけど、うまく動作しなかったから、Javascriptでイベントを後から追加することでエラーを回避
*/
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment