cancel
Showing results for 
Search instead for 
Did you mean: 

Library is not coming from Accept CDN.

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.

tan
Contributor
16 REPLIES 16

@tan

 

Could you share your code so we can see how you're calling Accept.js?

 

Richard

RichardH
Administrator Administrator
Administrator

 

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.

 

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

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.

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?

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?

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?

Yeah, they tried private browsing in Chrome and Firefox.


@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.