Maison > Questions et réponses > le corps du texte
P粉8035278012023-08-24 16:14:42
Ce javascript est très bien, il n'ouvre pas une nouvelle fenêtre ou un nouvel onglet.
window.location.assign(url);
P粉8648728122023-08-24 13:31:41
Cela fait 7 ans et je ne sais pas si cela fonctionne dans IE6 mais cela fait apparaître OpenFileDialog dans FF et Chrome.
var file_path = 'host/path/file.ext'; var a = document.createElement('A'); a.href = file_path; a.download = file_path.substr(file_path.lastIndexOf('/') + 1); document.body.appendChild(a); a.click(); document.body.removeChild(a);