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

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -