gpt4 book ai didi

javascript - 打印 JavaScript 响应

转载 作者:行者123 更新时间:2023-11-28 11:55:44 26 4
gpt4 key购买 nike

我有一个 php 脚本,可以响应正在上传的文件。我想“回应”这个回复,但我无法让它发挥作用

正如您在下面的脚本中看到的,我使用了“响应”,因为我想不出任何东西。这是如何工作的?

success:function(response){
if(response == 6563){
var uploaddiv = document.getElementById('uploadattachment');
uploaddiv.innerHTML = '<center><br><br><span style="font-size:18px; color:green;">File has successfully been uploaded.</span><br>You can now click this window away or upload another file</center>';
} else {
var uploaddiv = document.getElementById('uploadattachment');
uploaddiv.innerHTML = '<center><br><br><span style="font-size:18px; color:red;">Oops, something went wrong</span><br>' response '</center>';
}

最佳答案

您忘记正确连接字符串(缺少“+”):

uploaddiv.innerHTML = '<center><br><br><span style="font-size:18px; color:red;">Oops, something went wrong</span><br>'+response+'</center>';

关于javascript - 打印 JavaScript 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23829372/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com