I have a website in ASP.NET MVC. After loading the page, I get the error below. I passed the Youtube URL dynamically, but I get an error:
Load denied by X-Frame-Options: http://www.youtube.com/v/g5RM5StrMXY does not permit cross-origin framing
My code is:
<script> function closeVideowindow(k) { alert(k); var URL = $('#cnad_text_1').val(); var htm = '<iframe width="100%" height="100%" src=' + URL + '?rel=0 frameborder="0" allowfullscreen ></iframe>'; parent.$('.current').html(htm); parent.$('.current').removeClass('current'); parent.$.fancybox.close(); } </script> <h1>Upload Video</h1> <div class="form_scpop"> <form action="" method="get" name="sizeform"> <h2>Insert a youtube video Link</h2> <div class="col2"> <input id="cnad_text_1" name="cnad[text_1]" class="input_txt"> </div> <input name="" type="submit" value="Save" class="saveurl" onclick="closeVideowindow(this)" /> </form>
source share