1

Front-end browser directly previews the word file

1. Basic address (fixed)

let baseUrl = 'http://www.xdocin.com/xdoc?_func=to&_format=html&_cache=1&_xdoc='

2. The word address uploaded by yourself must be accessible on the public network, and must use encodeURIComponent to encode

let fileUrl = https://pan.baidu.com/s/1-2aDtACJZZCIaH9ls51izQ.doc

3. Use window.open to open

let baseUrl = 'http://www.xdocin.com/xdoc?_func=to&_format=html&_cache=1&_xdoc='
let url = encodeURIComponent(fileUrl)
window.open(baseUrl + url, '_blank')

张旭超
1.4k 声望222 粉丝

精通 html+div+css jquery, vue, angularjs, angular2, angular4, ionic, ionic2