【问题标题】:Summernote works on local, but not on productionSummernote 适用于本地,但不适用于生产
【发布时间】:2016-11-08 09:22:55
【问题描述】:

Summernote.js 库在本地工作而不在生产环境中工作的可能原因是什么?我使用 CDN,检查我的代码:

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="csrf-token" content="{{ csrf_token() }}" />
<title>{{ env('APP_NAME') }} | @yield('title')</title>

<!-- Favicon -->
<link rel="favicon icon" href="{{ asset('public/favicon.ico') }}">

<!-- Styles -->
<!-- include libraries(jQuery, bootstrap) -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">

<!-- include summernote css/js-->
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.css" rel="stylesheet">
<!-- End Styles -->

在关闭body标签的正上方

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
<script>
    $(document).ready(function() {
        $('#summernote').summernote({
            height: 300,
            dialogsInBody: true
        });
    });
</script>
<!-- End Scripts -->

【问题讨论】:

    标签: javascript summernote


    【解决方案1】:

    您也可以删除协议并保持这种状态,以便它适用于任何情况。

    <script src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
    

    【讨论】:

      【解决方案2】:

      我已经设法找出问题所在。 我正在为我的网络应用程序使用 SSL 证书,因此我必须将 URL 从 http 更改为 https

      我希望这个答案对其他开发者有所帮助!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-06-12
        • 1970-01-01
        • 2013-07-13
        • 2022-11-24
        • 2021-08-09
        • 1970-01-01
        • 2023-03-04
        相关资源
        最近更新 更多