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