Implementation of java download function

Don't talk nonsense, go directly to the code

 

<input   type=button   value="下载"  onclick="saveit('${path}')">

 

 

 

function saveit(src) {

    I1.document.location = src;

    savepic();

}

function savepic() {

    if (I1.document.readyState == "complete") {

         I1.document.execCommand("saveas");

    } else {

       window.setTimeout("savepic()", 10);

    }

}

 

This download does not support Google Chrome, but supports ie. If there is any other good download method, please leave a message for me. I am also looking for it, but I can't find any other.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326216388&siteId=291194637