0

I'm passing the following as a parameter to a modal:

"<iframe width="350" height="197" src="http://www.youtube.com/embed/jsExp2ebB4s?feature=oembed" frameborder="0" allowfullscreen></iframe>"

Then, I try to render it dynamically in a modal...in my show.js....

$("#modalpostvid").html("params[:vid]")

But it loads text (i.e. loads it as a string) instead of the embedded video.

How can I make it so that the video embeds?

Thank you.

1 Answer 1

1

try

$("#modalpostvid").html("<%= escape_javascript params[:vid].html_safe %>")
Sign up to request clarification or add additional context in comments.

3 Comments

still getting the string...not embedding
try calling html_safe on the params.
perfect. thank you. will accept your answer in 4 mins(when allowed).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.