2021年4月23日星期五

JQuery chrome CORB error, how can I fix it?

I am folowing a dashboard series on youtube for a Discord Bot and I have a problem with my JQuery code in a .pug file.

Code:

doctype  html(lang="en")    head    include includes/head.pug    script(src='https://replit.com/@xXGameCodingXx/Slave#dashboard/views/js/commands.js', type="text/javascript")    style.      #search { max-width: 300px; margin-top: -100px; }      #search + button { max-height: 38px; max-width: 38px; margin-top: -84px; }      h1 { margin-top: 10vh; }      li { cursor: pointer; }      .commands li { margin: 5px 0; border-radius: 5px; border: 1px solid lightgray; }    body    div.user-select-none      include includes/navbar.pug      .container        .jumbotron.text-center.bg-transparent          h1.display-4 Commands          p.lead.display-7 View GameCoding's #{length} commands !          hr          section#commands          .d-flex.justify-content-center            #search.form-group.p-3              input.form-control(type='search')            button.btn.btn-info              i.fas.fa-search          .row            .col-sm-3.categories              ul.list-group.mt-2.active                each category in categories                  +category(category)            .col-sm-9              ul.list-group.mt-2.active                each command in commands                  +command(command)  

Problem : when I click on an .catergory li element, it is supposed to have the active the class to it but nothing happens.

Does anyone know how to solve my problem ?

EDIT : I find out how to add the jQuery in but I now get a chrome CORB error : Cross-Origin Read Blocking (CORB) blocked cross-origin response https://replit.com/username/projectname with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

I tried finding an answer but what I found did not work for me. Here is the head.pug file : head.pug And the commands.js file : commands.js

Blockquote

https://stackoverflow.com/questions/67208276/jquery-chrome-corb-error-how-can-i-fix-it April 22, 2021 at 03:00PM

没有评论:

发表评论