2015-06-03 74 views
0

有沒有辦法再往下想我的文件前面加上一個鑽頭,而用戶能夠觸摸到在提示文本字段,因爲我現在有它設置這樣的:insertImage JS汽車前插文件位置

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

所以我有../../../../uploads/自動添加,所以用戶無法更改它?

回答

1

你可以試試這個方法:

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

賓果完美的作品! – PhpDude

+0

@phpcoder如果它幫助你,你可以將它標記爲可接受的答案,它會幫助我回來。在此先感謝:) –

+0

當然,我只是在等待它,讓我:D – PhpDude