I have a usecase where i need to load and execute different js file in my html file depending upon the browser type.
If browser is safari i need to load  <script type="text/javascript" src="./javascripts/applepay.js"> and if browser is any other i need to load two js files<script type="text/javascript" src="./javascripts/googlepay.js"></script> and <script async src="https://pay.google.com/gp/p/js/pay.js" onload="onGooglePayLoaded()"></script> .
Could you please let me know how can this be done?I tried a couple of solutions mentioned in other posts but it didnt work for me. Any code snippets will be very helpful.
 
     
    