The production environment encounters Highlight JS issues, while the development environment runs normally
P粉308089080
P粉308089080 2024-02-25 22:43:20
0
1
375

Can anyone figure out the solution why my Highlight JS is not working in production but it works perfectly in production?

I'm using Laravel 10, Cloudflare and Litespeed web server

This is my Highlight JS external CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/github-dark.min.css">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/highlight.min.js"></script>
<script src="https://unpkg.com/highlightjs-copy/dist/highlightjs-copy.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/highlightjs-copy/dist/highlightjs-copy.min.css" />

This is my script to initialize HighlightJS on post.blade.php

@push('script')
    <script>
        hljs.addPlugin(new CopyButtonPlugin());
        hljs.highlightAll();
    </script>
@endpush

I call it on main.blade.php

@stack('script')

thanks for your help

P粉308089080
P粉308089080

reply all(1)
P粉393030917

Now fixed, guys, it was weird, in development server I don't need to use JQuery, but in production server I need to use JQuery initialization code

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!