I have a javascript file located in a different server, and I am including the javascript file over http page like
<script type="text/javascript" src="http://www.example.com/scriptfile.js">
or over https page like
<script type="text/javascript" src="https://www.example.com/scriptfile.js">
The problem is, that I have page switching from http to https, for example, if a user is in
http://www.example.com/home(site home URL) and I load the javascript over http, now when the user navigates to another page like https://www.example.com/transaction (site transaction URL), I load the script over https and its working fine. From the mentioned transaction URL if the user hits the https://www.example.com/home (home URL changed to https), the script which I loaded over http fails because of unsecured content. Any suggestion to handle this is welcomed.