[Java] 纯文本查看 复制代码 if(zdm=="505")
{
zdnr=document.getElementById(indexnr).value.replace("▼a","");
var arr505=zdnr.split(",")
var other=arr505[1];
var yuanwen=arr505[0];
var translation;
const url = 'https://findmyip.net/api/translate.php?text=' + encodeURIComponent(yuanwen);
GM_xmlhttpRequest({
method: 'GET',
url: url,
onload: function(response) {
if (response.status == 200) {
var Jresponse = JSON.parse(response.responseText);
let translation = Jresponse.data.translate_result;
console.log(translation+"100");
}
},
onerror: function(error) {
console.error('翻译请求发生错误:', error);
}
});
console.log(translation+"100");
if(other.substr(other.length-1,1)!=".")
{
if(other.substr(other.length-1,1)!=")"&&other.substr(other.length-1,1)!="-"&&other.substr(other.length-1,1)!='"')
{
setInputValue(document.getElementById(indexnr), "▼a"+arr505[0]+"("+translation+"),"+arr505[1]+".")
}
}
else
{
setInputValue(document.getElementById(indexnr), "▼a"+arr505[0]+"("+translation+"),"+arr505[1])
}
}
为什么,291行是后出的结果 |