You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
703 B
27 lines
703 B
//输入自然语言
|
|
function enterWords() {
|
|
words = infos.words.value
|
|
wordsToMedia(words)
|
|
}
|
|
|
|
//翻译自然语言为动画
|
|
function wordsToMedia(words) {
|
|
//这里调用word_input
|
|
display(media)
|
|
}
|
|
|
|
//显示动画
|
|
function display(media) {
|
|
var xmlhttp;
|
|
if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();
|
|
else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
xmlhttp.onreadystatechange=function()
|
|
{
|
|
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
|
|
if (xmlhttp.responseText=="成功") alert("翻译成功!")
|
|
else alert("操作失败")
|
|
}
|
|
}
|
|
xmlhttp.open("GET","http://127.0.0.1:8000//",true);
|
|
xmlhttp.send();
|
|
} |