admin side panel drop-down links are not working I am working on project where i have a admin panel with side panel which includes links and drop-down elements. single links without drop-dwon are working but drop-down is not opening and showing other li elements. its working fine on localhost but it causing problmem when uploaded to server
CodePudding user response:
If you use various JavaScript/CSS Files, try to check if every file is in the same path as in the HTML code. Try testing the navbar element on a codepen so you can find the issue more easily.
Make sure that JQuery is first, then the Bootstrap script. Lookup that you don't have any duplicated bootstrap scripts. You should also add bootstrap.bundle.js or add popper.js so the dropdown can work.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP u1T9qYdvdihz0PPSiiqn/ /3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv l9liuYLaMQ/" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
Check this codepen with a example
CodePudding user response:
I checked my code and found that it was problem due to bootstrap cdn. it is http and hence it showed no problem on localhost but as my website is secure means https when i uploaded files on server it started throwing errors and links were not working. I replaced http with https in bootstrap links in head. and now it is working fine.