Home > front end >  Before and after the end of the separation under the condition of how to get on the returned images
Before and after the end of the separation under the condition of how to get on the returned images

Time:12-07

  images returned, but the front end under the separation of the ajax request picture, I won't have bosses teach it to me

CodePudding user response:

What is you return to the format of the picture is the url of the picture? If it is you in success method to img SRC assignment controls

CodePudding user response:

$(" # "user - get - vercode"). The attr (" SRC ", your image path );

CodePudding user response:

 & lt; Img &western nclick="changeCode ();" Id="img/& gt;" 


 
$. Ajax ({
.
Var uuid=XHR. GetResponseHeader (" uuid "),
# $(" img "). Attr (' SRC 'path);//image path
});


The function changeCode () {
Document. The getElementById (" img "). The SRC="https://bbs.csdn.net/topics/xxxx?" + Math. The random ();
}


CodePudding user response:

refer to the second floor usecf response:
$(" # "user - get - vercode"). The attr (" SRC ", your image path );

Is the flow:

The front end how to display the SRC?

CodePudding user response:

The
reference xiaoxiang dream reply: 3/f
 & lt; Img &western nclick="changeCode ();" Id="img/& gt;" 


 
$. Ajax ({
.
Var uuid=XHR. GetResponseHeader (" uuid "),
# $(" img "). Attr (' SRC 'path);//image path
});


The function changeCode () {
Document. The getElementById (" img "). The SRC="https://bbs.csdn.net/topics/xxxx?" + Math. The random ();
}



Not return the url, is this type:

How to deal with?

CodePudding user response:

Background.net, vue page, you can refer to the
The HTML

Js

The background

CodePudding user response:

The.net MVC pattern
View

The controller

CodePudding user response:

Refer to this https://www.cnblogs.com/dada521jj/p/12625264.html
The first flow to display image data conversion

CodePudding user response:

reference hedwig run 5 floor response:
Quote: refer to the third floor xiaoxiang dream response:

 & lt; Img &western nclick="changeCode ();" Id="img/& gt;" 


 
$. Ajax ({
.
Var uuid=XHR. GetResponseHeader (" uuid "),
# $(" img "). Attr (' SRC 'path);//image path
});


The function changeCode () {
Document. The getElementById (" img "). The SRC="https://bbs.csdn.net/topics/xxxx?" + Math. The random ();
}



Not return the url, is this type:

How to deal with it



OutputStream=new FileOutputStream (imageDest);
ImageIO. Write (destBufferImage, "JPG", outputStream);

Implementation, debugging to see what is the image path imageDest

CodePudding user response:

How can a group of people command, is the picture of the return path, 10 personal login back-end generate 10 pictures, play a new stored in the generated picture every time, the 1000 men?? The image stored? What's the point? The correct way is the back-end to the front-end base64, or flow, in the form of front end to display,

CodePudding user response:

$. Ajax ({
Type: 'get',
Url: ", "
ContentType: "application/json; Charset=utf-8,
"DataType: 'json,
Success: the function (data) {
If (data) {
$(" # img1 "). Attr (' SRC ', 'data: image/jpeg. Base64, '+ data. The data. The images [0]);
$(" # "img2). Attr (' SRC ', 'data: image/jpeg. Base64, '+ data. The data. The images [1]);
}
Want to help

CodePudding user response:

Such a simple thing, a large group of people in blather,
 & lt; Img SRC="http://localhost:8080/testShiro/getVerify"/& gt; 

Let the SRC for the backend interface can be directly, you don't copy my code, because I was looking at your figure are then knock on, mistyped a few letters what is normal, so I lost the address was a tired ah, why not post code, stick figure, how can I copy your code? Heart tired,

CodePudding user response:

d hand reference 14 floor response:
such a simple thing, a large group of people in blather,
 & lt; Img SRC="http://localhost:8080/testShiro/getVerify"/& gt; 

Let the SRC for the backend interface can be directly, you don't copy my code, because I was looking at your figure are then knock on, mistyped a few letters what is normal, so I lost the address was a tired ah, why not post code, stick figure, how can I copy your code? Heart tired,

Bosses, I have been solved, this should be the problem of two months ago the
  • Related