External JS and CSS files
I am having a problem with using an external javascript file for fonts from fonts.com. Every page that requires https connections (like login, register, and checkout), it doesn't auto load it but gives me warnings about unsafe scripts. How can I change that?
|
Re: External JS and CSS files
Can you paste your code snippet so we can have a look. I had some issues with fonts not appearing but it just took a few tweaks to the code.
|
Re: External JS and CSS files
I think this is beneath you but I'll ask:
Are you calling the JS file with http:// in the src? If not then there must be something coming from fonts.com. Looks like there is no problem with ssl: http://www.fonts.com/support/faq/using-web-fonts-with-ssl If you need to detect whether https is on in a template, I believe you can use {$current_protocol}. |
Re: External JS and CSS files
Here is the tag from fonts.com:
<script type="text/javascript" src="http://fast.fonts.com/jsapi/9ed357a7-37b3-41b3-ac75-d34a18b65993.js"></script> I have tried that in the head tags, I have tried it in the service_js.tpl file, but if I use this: {load_defer file="http://fast.fonts.com/jsapi/9ed357a7-37b3-41b3-ac75-d34a18b65993.js" type="js"} it does the same thing. It only does it on pages that are running secure (https). |
Re: External JS and CSS files
Well I guess I wasn't paying attention when I put it in. Of course a https page won't display external content from http sources. It has to be https. I fixed it by changing it to https. So I have:
<script type="text/javascript" src="https://fast.fonts.com/jsapi/9ed357a7-37b3-41b3-ac75-d34a18b65993.js"></script> And that is working now. |
Re: External JS and CSS files
You should also be able to replace src="https://..." with src="//..." then it'll load using the page's protocol. This avoid unnecessarily loading secure (uncompressed) files on your non-secure pages.
|
Re: External JS and CSS files
This will sove your issue...
https://market.x-cart.com/addons/custom-header-assets.html |
All times are GMT -8. The time now is 04:18 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.