How does javascript download an excel file?

  java, question
<form method="get" action="/app/PoiTemplate/NFC.xlsx">
 <button type="submit">Download!  </button>
 </form>
window.open("/app/PoiTemplate/NFC.xlsx")

Both of the above methods have opened the file. Are there any other downloading methods?

< a href = "NFC.xlsx" download = "NFC.xlsx" > download < /a >

The following is php header, try it yourself

header("Content-Type: application/vnd.ms-excel;   charset=UTF-8" );     
 header("Pragma: public" );     
 header("Expires: 0" );     
 header("Cache-Control: must-revalidate, post-check=0, pre-check=0" );     
 header("Content-Type: application/force-download");     
 header("Content-Type: application/octet-stream" );     
 header("Content-Type: application/download" );     
 header("Content-Disposition: attachment;  filename=11.xls " );     
 header("Content-Transfer-Encoding: binary " );