What would more ideal to detect a page protocol so as to access an external file via http. Due to security url's containing http will not work on a page with https. The call is for external JS file. Would it be more ideal to detect this in a JS conditional or go through a server side code to determine this before the page loads.
Thank you in advance.