【发布时间】:2013-05-06 13:42:47
【问题描述】:
场景是我从用户那里得到一个输入,并且需要为该文本提供音频。来自用户的输入存储在一个变量中。如何将变量的值赋予谷歌tts
<html>
<head>
<script src="jquery.js"></script>
<script>
function myfunction()
{
$("#div_style").html($("#text_area_id").val());
if(typeof(Storage)!=="undefined")
{
localStorage.lase=$("#text_area_id").val();
document.getElementById("div_style").innerHTML=" " + localStorage.lase;
var audio = new Audio();
audio.src ='http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=localStorage.lase;
audio.play();
}
}
</script>
</head>
<body>
<form name="myform">
<textarea name="text_area" id="text_area_id" rows="2" cols="16"></textarea>
</form>
<input type="button" onclick="myfunction()" value="save" />
<div style="color:red" id="div_style">
</div>is certified.
</body>
</html>
【问题讨论】:
-
与 Java 无关。 -1 表示不阅读有用的标签弹出窗口。
-
@AndrewThompson 好。你能帮忙吗?
-
“你能帮忙吗?”请使用正确的拼写方式,如“你”、“你的”和“请”。这使人们更容易理解和帮助。
-
@AndrewThompson 抱歉