laravel <script> 加载失败,源为“http://localhost:8000/lib/js/jquery.emojiarea.js”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53196589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Loading failed for the <script> with source “http://localhost:8000/lib/js/jquery.emojiarea.js”
提问by amany alshalatoni
This message appears in my console:
此消息出现在我的控制台中:
Loading failed for the
<script>
with source“http://localhost:8000/lib/js/config.js”
.
加载失败
<script>
with source“http://localhost:8000/lib/js/config.js”
。
The message appears after adding this in head:
在 head 中添加此消息后会出现以下消息:
<head>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/css/emoji.css" rel="stylesheet">
<script src="lib/js/config.js"></script>
<script src="lib/js/util.js"></script>
<script src="lib/js/jquery.emojiarea.js"></script>
<script src="lib/js/emoji-picker.js"></script>
Knowing that I make chat system in laravel with vue and socket and I will add emoji in input (send message).
知道我使用 vue 和 socket 在 laravel 中制作聊天系统,我将在输入中添加表情符号(发送消息)。
I added this in vue.js to make emoji picker:
我在 vue.js 中添加了这个来制作表情符号选择器:
<input data-emojiable="true" v-model="message" @keyup.enter="sendMessage"
id="btn-input" type="text" class="form-control input-sm"
placeholder="Type your message here..." />
回答by Reny Ramos
You could elaborate a little in that question, that would help, from my experience (it has happened to my a couple of times), it could be that the web navigator that you are using have a add blocker installed, if correct, try to disable it and try again.
您可以在该问题中详细说明一下,这会有所帮助,根据我的经验(我遇到过几次),可能是您使用的网络导航器安装了添加阻止程序,如果正确,请尝试禁用它并重试。
If it don't work, try using another web navigator, i got a similar problem but only in Firefox(it wouldn't fix the problem but at least would narrow it a little).
如果它不起作用,请尝试使用另一个网络导航器,我遇到了类似的问题,但仅在 Firefox 中(它不会解决问题,但至少会缩小一点范围)。
If you still get the problem you can try to access that URL to see if the link is really that one.
如果您仍然遇到问题,您可以尝试访问该 URL 以查看该链接是否真的是那个链接。
As a bonus try using the helper instead of the hard-coded link,
作为奖励尝试使用助手而不是硬编码链接,
<script src="{{asset('lib/js/config.js')}}"></script>
<script src="{{asset('lib/js/config.js')}}"></script>
回答by Prem G
For me, following meta
tag in header
caused the problem:
对我来说,以下meta
标签header
导致了问题:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
I removed the above meta
tag and it worked fine.
我删除了上面的meta
标签,它工作正常。