I'm studying HTML5+SpringBoot
I passed the data from HTML to javascript as follows:
th:onclick=" | show ('${test.data1}', '${test.data2}'); |
If the data is small, the value will be passed without any problems.
(I was able to check the js file by breaking it.)
If the size is as large as the image data, the following error will appear:
Is there any way to pass large data to the javascript side?
SyntaxError:unterminated string literal
jjs file
function show(data1,data2){
}
If you look at large
files such as image data, embedding them in HTML (whether JavaScript, HTML, or Base 64) delays loading the entire page, so you should prepare a separate file or API and pass the reference to them.
Also, SyntaxError: unterminated string literal
is an error caused by one of the following and does not appear to be a size issue.
To correct this error, check the following:
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Unterminated_string_literal
© 2024 OneMinuteCode. All rights reserved.