Reputation: 83
i have this code and this is not working
<script>
dialogFun();
function dialogFun(){
var code="<div style='font-size: 12px' id='dialog'><script src='https://content.jwplatform.com/libraries/xyz.js'> </script><div id='jwplyr'>Loading the player...</div><script type='text/javascript'>jwplayer('jwplyr').setup({'file': 'http://content.jwplatform.com/videos/xyz-lusPHdHK.mp4','image':'http://content.jwplatform.com/thumbs/xyz-320.jpg'});</script></div>";
console.log(code);
$( "body" ).append( code );
}
</script>
this is not working
Upvotes: 1
Views: 2315
Reputation: 3581
ESCAPE the "/" of closing tags
<script>
dialogFun();
function dialogFun(){
var code = "<div style='font-size: 12px' id='dialog'>"+
"<script src='https://content.jwplatform.com/libraries/xyz.js'><\/script>"+
"<div id='jwplyr'>Loading the player...</div>"+
"<script type='text/javascript'>jwplayer('jwplyr').setup({'file': 'http://content.jwplatform.com/videos/xyz-lusPHdHK.mp4','image':'http://content.jwplatform.com/thumbs/xyz-320.jpg'});<\/script><\/div>";
console.log(code);
$( "body" ).append( code );
}
</script>
Upvotes: 4