我正在尝试使用它来回显图像..
$actual_image_name = "image.png";
var msg = '<img src=http://website.com/uploads/$actual_image_name />';
但是我尝试过的一切都不起作用。它要么以“ http://website.com/uploads/$actual_image_name ”之类的形式返回,要么以其他路径返回。
我知道这很简单,但我需要一些帮助!谢谢!
我的完整代码;
function sendImg()
{
$actual_image_name = "image.png";
var msg = "<img src=http://website.com/uploads/$actual_image_name />";
document.getElementById("chatmsg").value = "";
var url = "sendMsg.php?userId=" + userId + "&strangerId=" + strangerId + "&msg=" + msg;
xmlHttp6.open("POST", url, true);
xmlHttp6.onreadystatechange = stateChanged6;
xmlHttp6.send(null);
}