Yasen Ivanov
Yasen Ivanov

Reputation: 1023

Summernote works on local, but not on production

What is the possible reason of Summernote.js library working on local, but not on production? I use CDN for it, check my code:

<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 -->

and right above closing the body tag

<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 -->

Upvotes: 0

Views: 858

Answers (2)

Tuhin Das
Tuhin Das

Reputation: 499

You can also remove the protocol and can keep it like this so it will work for any case.

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

Upvotes: 2

Yasen Ivanov
Yasen Ivanov

Reputation: 1023

I've managed to figure out the problem. I'm using SSL Certificate for my web app, so I had to change the URLs from http to https

I hope this answer will be helpful for another devs!

Upvotes: 0

Related Questions