Problems with browsing pages with AJAX - html

I have the following Menu on my page "Index.php"
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Snackbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Sales
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">Local</a></li>
<li><a class="dropdown-item" href="#">Residence</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Purchases</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Registrations
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item Exibe-Lista" onclick="Load_Page('../D_PHP/ProductRegistration.php');">Products</a></li>
<li><a class="dropdown-item" onclick="Load_Page('../D_PHP/CustomerRegistration.php');">Customers</a></li>
<li><a class="dropdown-item" onclick="Load_Page('../D_PHP/EmployeeRegistration.php');">Employees</a></li>
<li><a class="dropdown-item" onclick="Load_Page('../D_PHP/ManufacturerRegistration.php');">Manufacturer</a></li>
<li><a class="dropdown-item" onclick="Load_Page('../D_PHP/ContactRegistration.php');">Contacts</a></li>
<li><a class="dropdown-item" onclick="Load_Page('../D_PHP/SaleStatusRegistration.php');">Sale Status</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Notes</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Bills
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">To Receive</a></li>
<li><a class="dropdown-item" href="#">To Pay</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Search</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Reports</a>
</li>
</ul>
</div>
</div>
</nav>
Corresponding to the page "Index.php" I have the file "Index.js" with the following function:
function Load_Page(fileList)
{
if (fileList)
{
$.ajax({
type: 'GET',
data: fileList,
url: fileList,
success: function (data) {
$("#Content").html(data);
}
});
}
}
The AJAX function is called when the user clicks on the buttons on the Register Menu > Customers || Products || Employees || Manufacturer || Contacts || State of Sale. However, when I click on these buttons for the page to be invoked by AJAX, the following error occurs:
Uncaught ReferenceError: Load_Page is not defined at
HTMLAnchorElement.onclick
I am not able to find the error since the code is correct, and the function that is called in onclick is also. What would be the cause of this error?

Related

Submenu href issues

I am building a website application for a final course using Flask on an IDE.
I have a layout.html which I am borrowing as part of other html pages as well.
I have an issue with my submenu where only one href is clickable on the website and leads to the required html page, whereas the second href just return back to the index while having 302 redirection(seen on the debugger).
All the other links in my menu are working flawlessly, but I can't get to solve the issue.
Here is part of my layout.html
<nav class="navbar navbar-expand-md navbar-dark bg-dark border">
<a class="navbar-brand" href="/"><span class="red">Stock Portfolio Manager</span></a>
<button aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbar" data-toggle="collapse" type="button">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
{% if session.user_id %}
<ul class="navbar-nav mr-auto mt-2">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Portfolio
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/quote">Quote</a>
<a class="dropdown-item" href="/buy">Buy</a>
<a class="dropdown-item" href="/sell">Sell</a>
<a class="dropdown-item" href="/history">History</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Build a Portfolio
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/about">About</a></li>
<li><a class="dropdown-item" href="/build">Build</a></li>
<div class="dropdown-divider"></div>
<li class="dropdown-submenu">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" href="#">User Guide</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/expected returns">Expected Returns</a></li>
<li><a class="dropdown-item" href="/risk models">Risk Models</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<ul class="navbar-nav ml-auto mt-2">
<li class="nav-item"><a class="nav-link" href="/logout">Log Out</a></li>
</ul>
{% else %}
<ul class="navbar-nav ml-auto mt-2">
<li class="nav-item"><a class="nav-link" href="/register">Register</a></li>
<li class="nav-item"><a class="nav-link" href="/login">Log In</a></li>
</ul>
{% endif %}
</div>
</nav>
The href="/risk models" does the issues here but it's not because risk models.html has issues, because if I insert it instead of href="/expected returns" it will work fine.
Any help will be appreciated.

Bootstrap navbar add aditional dropdown that does not hide on mobile

On my website I use the Bootstrap navbar and on mobile the navbar is hidden and the toggle menu button appears...perfect!
But now I want to add another dropdown right to the toggle menu button that does not hide on mobile. So I added a new outside of the collapse div. But the result is not as I wanted.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
NEW DROPDOWN
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</nav>
The solution is quite simple. The new display also has to be inside the div that contains the "collapse navbar-collapse" classes. Also, you will have to create another button that opens the collapse directed with the dropdown id. Here is the solution. Regards.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNewContent" aria-controls="navbarNewContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
<div class="collapse navbar-collapse" id="navbarNewContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarNewDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
NEW DROPDOWN
</a>
<div class="dropdown-menu" aria-labelledby="navbarNewDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>

Getting logo to appear to the right of navbar [duplicate]

This question already has answers here:
Bootstrap align navbar items to the right
(24 answers)
Bootstrap NavBar with left, center or right aligned items
(14 answers)
Closed 2 years ago.
I'm using Bootstrap 4.2.1 and having issues trying to get the brand to appear to the right of my navbar. It's appearing just where I want it in a small viewport -- to the right of the hamburger -- but when expanded to a larger viewport, the logo appears to the left of the navbar items. I've tried using navbar-right, pull-right, float: right, placing the logo code in various spots in the navbar code, but I can't get it to appear on the right of the menu.
I'm probably missing something obvious, but any suggestions on how to get the logo to appear on the right? Here's the page. And below is an example of the code.
<nav class="navbar fixed-top navbar-expand-lg navbar-custom">
<div class="mx-auto d-lg-flex d-block flex-lg-nowrap">
<!-- menu/hamburger button -->
<button aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler custom-toggler" data-target="#navbarsExample11" data-toggle="collapse" type="button">Menu <span class="navbar-toggler-icon"></span></button>
<!-- logo -->
<a class="navbar-brand navbar-right" href="index.html"><img alt="CCFAC logo" height="42" src="images/logoSM.png"></a>
<!-- end logo -->
<div class="collapse navbar-collapse text-center" id="navbarsExample11">
<ul class="navbar-nav align-items-center">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown1" role="button">For Teens</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="marijuanaPrevention.html">Marijuana Prevention</a> <a class="dropdown-item" href="alcoholPrevention.html">Alcohol Prevention</a>
</div>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown2" role="button">For Parents</a> <span class="caret"></span>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="marijuanaPrevention.html">Marijuana Prevention</a> <a class="dropdown-item" href="alcoholPrevention.html">Alcohol Prevention</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="partners.html">For Teachers</a>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown4" role="button">Our Initiatives</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="futureForward.html">Future Forward</a> <a class="dropdown-item" href="talkTheyHearYou.html">Talk. They Hear You.</a>
</div>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown5" role="button">Media</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="https://sacramentoccy.smugmug.com" target="_blank">Photos</a> <a class="dropdown-item" href="https://www.youtube.com/channel/UC5IR7O7WLAA8I-fHUfEYFXw" target="_blank">Videos</a>
<a class="dropdown-item" href="https://www.facebook.com/SacramentoCCY/" target="_blank">Facebook</a>
<a class="dropdown-item" href="#">Instagram</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="calendar.html">Calendar</a>
</li>
<li class="nav-item">
<a class="nav-link" href="aboutUs.html">About Us</a>
</li>
</ul>
</div>
</div>
</nav>
Right now, your logo resolves after the hamburger button, but before your menu. You'll just have to have the logo resolve last.
<nav class="navbar fixed-top navbar-expand-lg navbar-custom">
<div class="mx-auto d-lg-flex d-block flex-lg-nowrap">
<!-- menu/hamburger button -->
<button aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler custom-toggler" data-target="#navbarsExample11" data-toggle="collapse" type="button">Menu <span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse text-center" id="navbarsExample11">
<ul class="navbar-nav align-items-center">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown1" role="button">For Teens</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="marijuanaPrevention.html">Marijuana Prevention</a> <a class="dropdown-item" href="alcoholPrevention.html">Alcohol Prevention</a>
</div>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown2" role="button">For Parents</a> <span class="caret"></span>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="marijuanaPrevention.html">Marijuana Prevention</a> <a class="dropdown-item" href="alcoholPrevention.html">Alcohol Prevention</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="partners.html">For Teachers</a>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown4" role="button">Our Initiatives</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="futureForward.html">Future Forward</a> <a class="dropdown-item" href="talkTheyHearYou.html">Talk. They Hear You.</a>
</div>
</li>
<li class="nav-item dropdown">
<a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown" data-toggle="dropdown" href="#" id="navbarDropdown5" role="button">Media</a>
<div aria-labelledby="navbarDropdown4" class="dropdown-menu">
<a class="dropdown-item" href="https://sacramentoccy.smugmug.com" target="_blank">Photos</a> <a class="dropdown-item" href="https://www.youtube.com/channel/UC5IR7O7WLAA8I-fHUfEYFXw" target="_blank">Videos</a>
<a class="dropdown-item" href="https://www.facebook.com/SacramentoCCY/" target="_blank">Facebook</a>
<a class="dropdown-item" href="#">Instagram</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="calendar.html">Calendar</a>
</li>
<li class="nav-item">
<a class="nav-link" href="aboutUs.html">About Us</a>
</li>
</ul>
</div>
<!-- logo -->
<a class="navbar-brand navbar-right" href="index.html"><img alt="CCFAC logo" height="42" src="images/logoSM.png"></a>
<!-- end logo -->
</div>
</nav>

How can I make my Bootstrap 4 navbar dropdown full width?

I am trying to get a full-width dropdown on a bootstrap 4 navbar. I am using a standard boot4 Navbar.
This is the navbar I am using
Here is how I need it to look :
<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="index.html">Start Bootstrap</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services.html">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownPortfolio" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Portfolio
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownPortfolio">
<a class="dropdown-item" href="portfolio-1-col.html">1 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-2-col.html">2 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-3-col.html">3 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-4-col.html">4 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-item.html">Single Portfolio Item</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBlog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Blog
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBlog">
<a class="dropdown-item" href="blog-home-1.html">Blog Home 1</a>
<a class="dropdown-item" href="blog-home-2.html">Blog Home 2</a>
<a class="dropdown-item" href="blog-post.html">Blog Post</a>
</div>
</li>
<li class="nav-item dropdown show">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBlog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Other Pages
</a>
<div class="dropdown-menu dropdown-menu-right show" aria-labelledby="navbarDropdownBlog">
<a class="dropdown-item" href="full-width.html">Full Width Page</a>
<a class="dropdown-item" href="sidebar.html">Sidebar Page</a>
<a class="dropdown-item" href="faq.html">FAQ</a>
<a class="dropdown-item" href="404.html">404</a>
<a class="dropdown-item" href="pricing.html">Pricing Table</a>
</div>
</li>
</ul>
</div>
</div>
Replace your class container with container-fluid
Delete ml-auto from navbar-nav

Bootstrap4 dropright menu within a dropdown menu closes parent menu

I've got a dropright menu "F" within a dropdown menu that I need to expand when clicked. Right now it does something strange - it closes the parent menu (the dropdown one). Also the dropright menu is expanded by default when it is explicitly said it should not be.
Could not find any information to my problem so I'm asking for your help.
Here's a gif of what happens.
The code to reproduce this is the following:
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
<li class="nav-item">
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Operations
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">A</a>
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">B</a>
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">C</a>
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">D</a>
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">E</a>
<div class="dropright">
<a class="dropdown-toggle nav-link" id="navbarDropdownMenuLink2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
F
</a>
<div class="dropdown-submenu" aria-labelledby="navbarDropdownMenuLink2">
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">F1</a>
<a class="dropdown-item" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">F2</a>
</div>
</div>
</div>
</div>
</li>
</ul>
Thank you in advance!
You would need some JavaScript for the nested dropdowns; there is no dropdown-submenu class; see if the following code gets you what you want...
$(document).ready(function() {
$('.dropdown-menu a.dropdown-toggle').on('click', function(e) {
if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
}
var $subMenu = $(this).next(".dropdown-menu");
$subMenu.toggleClass('show');
$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
$('.dropdown-submenu .show').removeClass("show");
});
return false;
});
});
.dropdown-submenu {
position: relative;
}
.dropdown-submenu a::after {
transform: rotate(-90deg);
position: absolute;
right: 6px;
top: .8em;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-left: .1rem;
margin-right: .1rem;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<nav class="navbar navbar-expand-sm navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand" href="#">Home</a>
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#">Privacy</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Operations
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="#" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">A</a></li>
<li><a class="dropdown-item" href="#" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">B</a></li>
<li><a class="dropdown-item" href="#" asp-area=" " asp-controller=" " asp-action=" " asp-route-companyId=" ">C</a></li>
<li><a class="dropdown-item" href="#" asp-area=" " asp-controller=" " asp-action=" " asp-route-companyId=" ">D</a></li>
<li><a class="dropdown-item" href="#" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">E</a></li>
<li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle" href="#">F</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">F1</a></li>
<li><a class="dropdown-item" href="#" asp-area="" asp-controller="" asp-action="" asp-route-companyId="">F2</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</nav>