• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP expression in a JavaScript

 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use a JSP expression in a Javascript.
The JavaScript line I'd like to do this with is:
playerParams.audioStream = "audio/WhenIfallInLove.mp3";
I would like to have this be:
playerParams.audioStream
= <%=streamName%>;
Apparently Javascript complains loudly about this. I am getting the streamName URLencoded and want to get it as a variable to the JavaScript.
How can I get this to work?
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes JavaScript is complaining likely because you will need quotes around the variable:
playerParams.audioStream = "<%=streamName%>";
That should straighten it out!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!