Use seven cattle CDN cause ajax error Comments{“error”:”get from image source failed: E405″}

Find

Because before routing always wanted to tryThird-party social comment boxWP to replace their comments,But nonetheless could not find any suitable selection,Now once again we had to exchange for carrying the comment box。(Well, anyway, no one will come to comments。)

But after the exchange's own comment box I found a problem,That is when the matter turned Ajax publish what comments,Will lead{“error”:”get from image source failed: E405″}Error and thus can not comment。

Reason

After the conclusion by google,according toHereThe records show that seven cattle CDN problems。of course,Facts have proved that the problem is indeed CDN,But it may not be only seven cattle would lead to such a right,Or we can guess,CDN is leading to the problem。

The principle isCDNPut yourcomments-ajax.jsGo to the file cache,The results lead to the wrong path,This time we have two options to fix this problem。

  1. Js file can modify it to support your CDN path
  2. This document will be excluded from the mirror list separately the CDN

Solution

1、Modify comments-ajax.js file

The advantage of this method is that you can still experience the full image of CDN services,You need to open your theme directory under the corresponding file and then modify it,Find the following code fragment (generally should be in the beginning)

Then in the code behind the phrase is added

Such,After editing should look like below

Then save enough uploaded,of course,I hope you can get seven cows file updates XD。

2、Adding CDN Mirror exception

If you're like me, useWP Super CacheTo enable CDN mirror,Then you can also choose a way I kind of repair - the js file directly excluded from the list of mirrors like a,Although more time to load a js file,But eliminating the need to deal with seven cattle that slow refresh process,But it is still very good,Immediate ah ~

Other,I think the rest of CDN plugin should also have a similarExclusions,Then you can understand the spirit of their own to plug in the room - as for direct use code CDN great God ......Please go left ╮(╯▽╰)╭

All right,find youWP Super CacheofCDN page,Then, find out belowIf it is preceded by the exclusion "This one,willcomment-ajaxFill into the like。

[warning]
Remember to use a comma between multiple statements separated English Oh!
[/warning]

As shown in FIG like the completed:

QQ20140701-1

 

Such,This is only one file to be excludedCDNOutside the。

The same time,You can page themInspect ElementTo verify,For example, this:

QQ20140701-2

When are you going to test this comment,It has been found that it can be used normally。

But at the same time the route was submitted seven cattle cache update,By the finish of this article,Seven cattle side of the document is still not updated ╮(╯▽╰)╭

In short,Such an approach is effective if the replacement tile ~ SaveCDN,Do not goManually modify js addressThe。

Original article written by Gerber drop-off:R0uter's Blog » Use seven cattle CDN cause ajax error Comments{“error”:”get from image source failed: E405″}

Reproduced Please keep the source and description link:https://www.logcg.com/archives/579.html

About the Author

R0uter

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Comments

  1. Ok,According to the online code changing for the better,But found or not,See "Plug-in and then go look for yourself," he suddenly thought,It is not a plug-in problem,Disable the static widget,Try,Really good,thank!

Leave a Reply

Your email address will not be published. Required fields are marked *