简体   繁体   中英

jQuery & Bootstrap scripts messing up

Currently, have a web app for appointments. I had a question answered around last week at the following link: jQuery and Bootstrap dialog not coming up

I got this working. However, I just noticed that this messes up my NavBar that is stored in my layout file. On any other page, the NavBar works, but on the Calendar page it doesn't respond. The only thing I can think of is the scripts are clashing.

I tried taking them out of my calendar page but this causes my calendar to not pop up with a dialog. I must be doing something wrong here but I honestly don't know.

Here is my layout file's scripts.

@Styles.Render("~/Content/Site.css")
@Styles.Render("~/Content/jquery.datetimepicker.css")
@Styles.Render("~/Content/fullcalendar.css")
@Scripts.Render("~/bundles/modernizr")
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>

My Calendar File Scripts:

@section Scripts{
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.js"></script>
    }

If more code is needed, I can supply it.

EDIT Image of my console after I load Calendar: 在此处输入图片说明

EDIT 2 Image of my console after I load Calendar after removing one instance of Jquery: 在此处输入图片说明

Turns out I had an error on my Layout Page that was causing hassle.

The scripts section weren't being rendered as I had RenderSection("Scripts", false)

Removed the scripts section and that and the error went away!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM