Hey. A client has reached out to me with the following error message:
Please include Accept.js library from cdn.
And in the console:
Library is not coming from Accept CDN.
However the library is coming from the CDN. I have been unable to reproduce the error without actually loading it from somewhere else. The client has already tried clearing the browser cache. What else could be causing this issue?
Thank you.
04-04-2017 12:04 PM
04-04-2017 12:56 PM
Here it is.
<script type='text/javascript' src='https://js.authorize.net/v1/Accept.js'></script>
It works for me. I tested it in 3 different browsers.
04-04-2017 01:18 PM
Try adding the character set command and see if that helps.
<script type="text/javascript" src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>
Richard
04-04-2017 01:30 PM
Would the following tag have the same effect?
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I have that at the top of the page. The recommended way to add scripts on the platform we're using does not give us the ability to add any attributes to the script tag itself. If this was the problem, would it not cause the same error for everyone? I have had no such errors on my end and I have tested it in Chrome, Firefox, and Edge. Also, some Googling tells me that a missing charset would result in a different error. Thanks.
04-04-2017 01:40 PM
Hi @tan,
The script itself is doing some integrity checking to see if it's intact and served from the right place. If a browser loads the script but interprets it with a different encoding, those checks could fail on that browser.
Can you test your site on your end, but change your browser's encoding to a different charset and see if you can duplicate the error?
04-05-2017 11:58 AM
Hey @Aaron. Thanks for your help. I tried using a few different character encodings but I was unable to reproduce the error. What other checks could be failing?
04-05-2017 12:53 PM
Trying to debug a third-party's browser is quite difficult!
I imagine it could also be other factors such as plugins. Have you had the client try an incognito chrome, or private browsing firefox mode?
04-05-2017 01:49 PM
Yeah, they tried private browsing in Chrome and Firefox.
04-05-2017 02:39 PM
@tan wrote:
Hey @Aaron. Thanks for your help. I tried using a few different character encodings but I was unable to reproduce the error. What other checks could be failing?
The main check is just the source of the script. Accept.js script calls another script on our site (AcceptCore.js) which is basically checking the source URL of the first script. If that URL doesn't match https://js.authorize.net/v1/Accept.js, it throws the error.
If that customer's browser is seeing that the script has a different source, I might start to be concerned about some really aggressive cache upstream that somehow is serving redirects instead of content, or possibly some malware on the customer's end. I'm trying to think of other ways this could fail and am coming up blank.
04-05-2017 05:08 PM