Embed video javascript code from database in PHP

This is probably a pretty simple thing. I am testing out several video hosting services where I host the videos and use their embed code to display on my site.Now this embed code is stored in the database and is associated with each topic. So on a given page there could be 20 topics. So when a user clicks on …

via PHP Website Development » Search Results » ajax:

Embed video javascript code from database in PHP

This is probably a pretty simple thing. I am testing out several video hosting services where I host the videos and use their embed code to display on my site.
Now this embed code is stored in the database and is associated with each topic. So on a given page there could be 20 topics. So when a user clicks on any topic – using ajax I pull the embed code and display it in a given div.
This works fine for the embed code that uses or like in youtube and other services. But there are others that give you a javascript code to embed like shown below

So this type of embed code cos its javascript. Is there anyway to get this working. Appreciate your input Thanks
………………………………….

JQuery does a lot of crazy stuff with script tags. It’s not terribly well documented, but some methods like .html(data) will strip them out. The ajax methods also do some crazy evaluation magic.
This answer may come too late, but at least for the Vidyard case you can use the alternative iframe embed code. Click the checkbox in the embed area that says Using Tumblr, Posterous, or just having trouble embedding? Try our fallback code to get it.

For more info: Embed video javascript code from database in PHP

PHP Website Development » Search Results » ajax

Embed video javascript code from database in PHP

Share this post:

Related Posts

Leave a Comment