| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
External JS and CSS files | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
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?
__________________
Sizzle Factor @ www.sizzlefactor.com Simply X-Cart @ www.simplyxcart.com VitalBGS @ www.vitalbgs.com For all of your X-Cart solutions! X-Cart versions 4.4.0 to 5.0 |
|||||||||
#2
|
|||||||
|
|||||||
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.
__________________
Live with Gold 4.5.1 Dedicated Linux server MaxCDN 4 pull zones Dedicated SSL |
|||||||
#3
|
|||||||||
|
|||||||||
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}.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#4
|
|||||||||
|
|||||||||
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).
__________________
Sizzle Factor @ www.sizzlefactor.com Simply X-Cart @ www.simplyxcart.com VitalBGS @ www.vitalbgs.com For all of your X-Cart solutions! X-Cart versions 4.4.0 to 5.0 |
|||||||||
#5
|
|||||||||
|
|||||||||
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.
__________________
Sizzle Factor @ www.sizzlefactor.com Simply X-Cart @ www.simplyxcart.com VitalBGS @ www.vitalbgs.com For all of your X-Cart solutions! X-Cart versions 4.4.0 to 5.0 |
|||||||||
#6
|
|||||||||
|
|||||||||
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.
|
|||||||||
#7
|
|||||||
|
|||||||
Re: External JS and CSS files
This will sove your issue...
https://market.x-cart.com/addons/custom-header-assets.html
__________________
Pedro
digitalnotions.i2u.shop shop.modestclassy.com.au4.1.9 X-Cart
X-Cart Business 5.3.6.0 Multi-vendor 5.3.6.0 |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|