How to add bootstrap CSS and JQuery after page load

Add Bootstrap library files after window load

Need to load jQuery and CSS bootstrap file after load page for optimize page speed and reduce the load time of page add both files after page open in the window. After loading files in the window will helps to reduce the loading time and increase page speed as well.

 

<script type="text/javascript">

jQuery(document).ready(function(){
jQuery('head').append('<link type="text/css" href="css/style.css?ver=1.1" 
rel="stylesheet"><link rel="stylesheet" 
href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" 
type="text/css" /><link type="text/css" href="css/popup.css" rel="stylesheet" />');
$.getScript('https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js');
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js');
$.getScript('javascript/script.js');
});

</script>

above code also help to load other stylesheet and javascript files after the page comes in window.  For adds, files append child in the head or get script function.