backend now returns an address. You can download it by yourself if you open it directly in the browser, but how to download it with jsIE? What does the back end mean by using iframe?
backend now returns an address. You can download it by yourself if you open it directly in the browser, but how to download it with jsIE? What does the back end mean by using iframe?
if the document is connected
add the following code to the callback function of the interface
var a = document.createElement('a');
a.href = url;
a.download = 'test.word';
a.click();
if you return a document, you can use fetch to receive and download
fetch("/api", { credentials: 'include' }).then(x => x.blob()).then(x => {
var a = document.createElement('a');
var url = window.URL.createObjectURL(x); // blob (blob )
a.href = url;
a.download = 'test.pdf';
a.click();
window.URL.revokeObjectURL(url);
})
you can download the file through the src attribute in the iframe tag. Src is the url, returned to the front end by the background. It is written as follows:
function downloadFile(url) {
try{
var elemIF = document.createElement("iframe");
elemIF.src = url;
elemIF.style.display = "none";
document.body.appendChild(elemIF);
}catch(e){
}
}
<input type="button" value="1" onClick = "downloadFile('http://')">
for example, (- 1) get 225 ...
the map of Tetris is implemented in a two-dimensional array, and squares are also implemented in arrays, but I just don t understand how maps interact with squares. is how to know where the square is on the map. Besides, although the two-dimensional ...
for example, if there is a set of numbers such as 1, 2, 5, 7, 11, 14, how can Filter come up with two sets of numbers: [1, 2] and [5, 6, 7, 7]? ask for advice ...
the original rule is as follows [1-9] {1} [0-9] {3} now I want to rule out the result of 2035. How do I write it? because I m in a hurry, I can t think for myself. Regularity is my weakness. Thank you! ...
there is no vue rich text with formulas, that is, formulas in mathematics, physics and chemistry ...
vue scaffolding code php back-end server language does not know how to get the content entered in the vue-quill-editor rich text editor api given to the official website I just say that new a quill and then use getContents (); to get the content how ...
as shown in the figure, if you want to do a login interception based on $api.getStorage ( userId ), the desired effect of is 1. Enter the page that can open the green box (main.html), but the other three in the red box cannot be opened directly (mes...
...
I m not familiar with the git command. I used vscode s git management tool to "undo the last commit " twice, but now I don t want to undo those commits. How can I restore them? ...
ask what is the development environment and language of short video playback software similar to Douyin requirements: if developers only have JAVA and front end now, what is the best development environment? is it okay to use Hbuilder s MUI? wi...
generate the corresponding loop based on the given number. If 2 is given, a double cycle is generated, and 3 is a triple cycle if 3 is given, then for (let i = 0; i < arr.length; iPP) { for (let j = 0; j < arr.length; jPP) { ...
for the first time, separate items from front and rear, don t laugh. this is the "account list " interface given by the backend. I installed axios but couldn t get the data. mounted:function () { var Authorization = getCookie( token ); axios...
there is a set of numbers, for example, 3, requires that the sum equal to 3 is selected from this group of numbers (3 added numbers). For example, the three added numbers cannot be the same (for example, 1: 1, 1: 1), and there is no order requirement fo...
< H2 > I want to change the red box in the picture to how many days ago < H2 > ...
< H2 > set up two tables as follows. How can curd change the two tables at the same time, that is, query the data of the two tables? in addition, do you use this method much in the actual project < H2 >? < H2 > my_class < H2 > CREATE TABLE `my_class`...
ask for help from seniors: if the long address is xxxx, Nanjing Road, Heping District, Tianjin how can it be dealt with by means of no manual intervention: Tianjin; Heping District; Nanjing Road; this kind of administrative division? because the inp...
...
< H2 > question < H2 > static content can be displayed, but content obtained by ajax cannot be displayed < H2 > app.js < H2 > commented to get user information wx.getSetting({ success: res => { if (res.authSe...
...
I would like to ask the gods, what are the ways to get the data or pictures on a website? There is no example reference, I currently understand the method is the web crawler. ...