I have a default page which has bootstrap tabs. When i click one of the tabs the content loads from the relevant DIV but when i click the other tab it does not replace the other Div.
All code below
Default HTML
function load_RbCode() {
document.getElementById("rbCode").innerHTML = '<object type="text/html" data="functionality.html" style="width: 100%; height: -webkit-fill-available"></object>';
}
function load_HelpModalCode() {
document.getElementById("helpModalCode").innerHTML = '<object type="text/html" data="help_modal.html" style="width: 100%; height: -webkit-fill-available"></object>';
}
<div>
<ul class="nav nav-tabs">
<li class="nav-item">
<a id="rbCodeMenu" class="nav-link" href="#" onclick="load_RbCode()">Rule Builder Code</a>
</li>
<li class="nav-item">
<a id="helpModalCodeMenu" class="nav-link" href="#" onclick="load_HelpModalCode()">Help Modal</a>
</li>
</ul>
<div id="rbCode"></div>
<div id="helpModalCode"></div>
</div>
As i said it goes to the correct file and displays. If i click the 'Help' tab first then the 'Rule' tab it does replace but i think this is because there is a lot more HTML in the 'Rule' file but if i select 'Rule' tab first then the 'Rule' HTML still displays and it should just be a button which launchs a Modal
<objectjust to display a HTML file? You could load it into a regular div using AJAX, or use an iframe.<objectis normally used for multimedia like Flash, or embedding a PDF or something