0

so I am using Java Play framework. In my view part, I pass in the variable from Java back end as string. Then I want to store that string in javascript in the view part, how can I do that? code:

enter image description here

And it seems like output doesn't recognize the @message, so it shows up nothing. The return type from Java side is String. So JavaScript string and scala string are different? And what's the correct syntax?

James Xia
  • 173
  • 1
  • 2
  • 9
  • This is a different question, it's not about php, it's scala and javascript, please reopen the question, thanks. – James Xia Jul 26 '16 at 20:39
  • This is exactly the same question, just with different syntax. @message is a string, so when you use it in javascript you have to quote it: `var output = "@message";` – Salem Jul 27 '16 at 10:50
  • It's not correct, I just tried it...I mean how to pass string from scala to javascript on Java play template, same string type. I cannot find answer online. – James Xia Jul 28 '16 at 05:41

0 Answers0