【发布时间】:2018-06-08 01:40:57
【问题描述】:
这些是我的 head 函数中的所有脚本:
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
这是我的刀:
<td> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
</td>
</tr>
<div class="modal fade bs-example-modal-lg" id="myModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Image</h4>
</div>
<div class="modal-body">
<a class="thumbnail">
<img src="{{asset( $ticket->imagePath)}}" width="300" height="200" onclick="showImage(this,<?php echo $ticket->title ?>)">
</a>
</div>
</div>
</div>
</div>
@endforeach
</tbody>
</table>
</div>
但这不起作用
加载资源失败:net::ERR_NETWORK_CHANGED
请我已经尝试了几天,我需要帮助
【问题讨论】:
-
head 部分是在主布局文件还是主模板中?你上面的刀片是单独的文件吗?
-
没有它在我的刀片中,它不是扩展或部分
-
@webDev 现在看看问题更简单了,这会作为弹出窗口打开,但是里面的图像没有显示
-
在我的控制台中,弹出窗口打开但里面没有图像,@webDev
-
将静态图像文件(来自您的公共目录)放入
<img src="{{asset( $ticket->imagePath)}}" width="300" height="200" onclick="showImage(this,<?php echo $ticket->title ?>)">我认为问题在于我们的路径
标签: javascript php laravel bootstrap-modal