我在ASP.NET MVC中有一个网站.页面加载后,我收到以下错误.我已动态传递Youtube网址,但收到错误消息:
Load denied by X-Frame-Options: http://www.youtube.com/v/g5RM5StrMXY does not permit cross-origin framing
Run Code Online (Sandbox Code Playgroud)
我的代码:
<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">
<!-- <frameset>
<iframe src="https://www.youtube.com/watch?v=t090py6b0lM" width="853" height="480"></iframe>
</frameset >-->
<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>
Run Code Online (Sandbox Code Playgroud) 我使用jQuery上传图像文件,但每当我上传任何选定的图像.为此,我需要Priview在IE浏览器中显示Image.但Firefox和Chrome支持的下列功能集.
<Script>
function previewImages(input) {
$('#ImagePreview').html('');
var fileList = input.files;
var anyWindow = window.URL || window.webkitURL;
for (var i = 0; i < fileList.length; i++) {
var objectUrl = anyWindow.createObjectURL(fileList[i]);
$('#ImagePreview').append('<a href="#" class="remove"></a><img src="' + objectUrl + '" class="img-polaroid" style="height:70px;width:70px;">');
window.URL.revokeObjectURL(fileList[i]);
}
}
<h1>Upload Image</h1>
<div class="form_scpop" >
<form action="" method="get">
<input type ="file" onchange="previewImages(this);" multiple/>
<input name="" type="" id="image_alt" class="input_txt" />
<div id="ImagePreview" ></div>
<button class="btn btn-info" type="button" onclick="closeimgwindow()">Save</button>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)