Update
resolved
main problems
can bootstrap modal box pass parameters only pass strings of numeric type?
background description of the problem and my attempt
question background:
I am writing a web page with jsp, in which there is a table with a picture link in each row of the table. Now I want to trigger the modal box by clicking the button, and the picture is displayed in the body of the modal box. Find a way on the Internet to pass the SRC value to the img in the modal box.
example:
-
There is a button in the
- table that triggers the modal box, onclick= "showImg (imgUrl)"
- there is an img tag in the modal box body, and id is "theImgUrl". The
- js function is:
function showImg(imgUrl){
$("-sharptheImgUrl").attr("src",imgUrl);
}
my test
- I thought my imgUrl was empty, but checking the data is not empty, which confirms
- I replaced the img tag in the modal box body with input. Using the above value passing method, I found a problem: I can pass a string like "1233000" to input, but not others, including strings with non-numeric characters such as English and Chinese
- looked up related questions on the Internet, but found no similar questions and answers. So I wonder what I did wrong.
so, repeat my question
can bootstrap modal box pass parameters only pass strings of numeric type?
I understand that this should not be the case, but how to solve the problem I encountered? Has any of the great gods encountered this problem?
p. S. : I do the back-end, the front-end is basically not, these two days saw some bootstrap things, do a simple page encountered this problem. Let me ask you something.