简体   繁体   中英

how can i open local file with a variable link in HTML JS

I have xxx(1).xml,xxx(2).xml,xxx(3).xml files. I'm trying to open these files in js function. I used this code

href="xxx.xml"

in html but it only works for one local file. And I also tried in javascript

window.open(path,"_self")

but this isn't working like I want. is there any methods for this?

You can not open local files in the browser through javascript. since it causes security issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM