gpt4 book ai didi

javascript - insertImage JS 自动添加文件位置

转载 作者:行者123 更新时间:2023-12-03 09:59:53 28 4
gpt4 key购买 nike

有没有一种方法可以在我的文件中添加向下钻取,而用户无法在提示文本字段中触摸它,因为我目前的设置如下:

function iimages() {
var img = prompt ("Enter the image link", "../../../../uploads/");
if (img != null) {
editor.document.execCommand("insertImage", false, img);
}
}

那么我在哪里有../../../../uploads/自动添加它以便用户无法更改它?

最佳答案

您可以尝试以下方法:

function iimages() {
var img = prompt ("Enter the image link", "example.jpg");
if (img != null) {
editor.document.execCommand("insertImage", false, "../../../../uploads/" + img);
}
}

关于javascript - insertImage JS 自动添加文件位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30630787/

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