ajax - Rails .js render html in modal -
i'm passing following parameter modal:
"<iframe width="350" height="197" src="http://www.youtube.com/embed/jsexp2ebb4s?feature=oembed" frameborder="0" allowfullscreen></iframe>"
then, try render dynamically in modal...in show.js....
$("#modalpostvid").html("params[:vid]")
but loads text (i.e. loads string) instead of embedded video.
how can make video embeds?
thank you.
try
$("#modalpostvid").html("<%= escape_javascript params[:vid].html_safe %>")
Comments
Post a Comment