我正试图在新窗口中打开每个图像的全尺寸图像。我使用此代码:使用剃刀和javascript在新窗口中打开图像
<script type="text/javascript">
function openImage(imageUrl) {
window.open(imageUrl);
}
@foreach (var image in Model.Images)
{
<img src="@Url.Action("Thumbnail", "Done", new { width = 150, height = 150, file = @imagen.filename })" alt="@imagen.filename" onclick="openImage('@Url.Content(ViewBag.Path + @imagen.filename)')" />
}
但是使用这个,当我点击图片不能打开任何东西。
你能帮我解决这个问题吗?
谢谢你在先进
编辑的功能openImage由于错误代码
JS控制台中的任何错误? 请调试'imageUrl'到'openImage'的值。 – phts
BTW'imageUrl'参数和'window.open'中的'imgUrl'。这是你的问题的原因? – phts