"Math" - undefined error in an embedded object

Im using ajax to download youtube video to download page

$(document).ready(function(){ $.ajax({ url : '/myurl', type:"post", data:{"d": $('#d_id').val()}, async:false, success:function(data){ $('#container').html(data); //data is an emebed string //This is what i get from PHP page /*<embed class="frame" width="850" scrolling="no" height="415" frameborder="0" src="http://www.youtube.com/embed/' . $k[0] . '?showinfo=1&amp;modestbranding=1&amp;autoplay=1&amp;rel=0&amp;iv_load_policy=3&amp;cc_load_policy=1&amp;loop=1&amp;playlist=' . $k[0] . '&amp;wmode=transparent" frameborder="0"" allowfullscreen="yes" wmode="Opaque"></embed> */ } }); }); 

Work in every browser except IE

enter image description here

IM getting the error "Math is undefined" according to the screenshot If I insert a more serious error in the iframe im, for example, "__flash__removecallback is undefined".

UPDATE

If I use emebed, all this does not work in IE8

Anyone help me IE makes me NUTS

+4
source share
1 answer

Finally i got it

Server side (e.g. Ajax response)

 if (preg_match('/MSIE 9.0/', $_SERVER['HTTP_USER_AGENT'])) { /*for IE 9.0 generate with objace tag*/ ?> <object type="application/x-shockwave-flash" data="VIDEO_URL"> <param name="movie" value="VIDEO_URL" /> </object> <?php } else { /*rest of all browsers,in iframe*/ ?> <iframe src="VIDEO_URL"></iframe> <?php } ?> 
+3
source

Source: https://habr.com/ru/post/1441438/


All Articles