I currently have a problem with IE8 / 7 (I have no choice, I have to add support for them before anyone moans), where IFrames from a YouTube video causes a problem with adding additional URLs to the story, so when hitting back, I need to do this 2-3 times before actually returning, my current solution seems to work in new browsers, but not with the two problems that I encountered, the current solution:
<script type="text/javascript"> $(document).ready(function () { $("iframe").each(function () { var ifr_source = $(this).attr('src'); if (ifr_source.indexOf("youtube") != -1) { var parent = $(this).parent(); var ifr = $(this).detach(); var wmode = "wmode=transparent"; if (ifr_source.indexOf('?') != -1) { var getQString = ifr_source.split('?'); var oldString = getQString[1]; var newString = getQString[0]; $(this).attr('src', newString + '?' + wmode + '&' + oldString); } else $(this).attr('src', ifr_source + '?' + wmode); ifr.appendTo($(parent)); } }); });
source share