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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -