cacheSince version 2.0.73 plugin Simple Ads Manager supports caching plugins . He really supports ALL caching plugins and it’s great . But there is a small fly in the ointment. This fly is javascript function {javascript}document.write(){/javascript}.

This function can be used only in the process of building DOM (Document Object Model) and it absolutely can not be used after the DOM has already been built. However, when SAM is used in caching plugins compatibility mode, it inserts advertisements into a document using AJAX requests after the browser is already built DOM of document. Inserting function {javascript}document.write(){/javascript} in the output document at this point, guaranteed kills this document!

How to deal with this problem I want to talk about in this article. If you do not use javascript codes as codes of advertisements, then you have nothing to worry about. Otherwise, you should read this article.

The only true way to combat this scourge, is the removal of function {javascript}document.write(){/javascript} from code of the ad. For this purpose it is necessary to inspect an ad code regarding this function. For example, survey the code of Yandex Direct ads:

What to do? Just replace the {javascript}document.write(){/javascript} with what they wanted to write to the document during its creation:

It’s very simple … If the function is defined clearly… And if not?

If not, create a test HTML document and paste the code into it. For example (Text Links Ads):

Open the document code, it is possible, in any browser, and see what came of it:

This code is not difficult to transform to data for image mode of plugin:

img-mode

SAM Image Mode

That’s it. If you always will follow these instructions, you will not have problems with Simple Ads Manager caching plugins compatibility mode.

Good luck!

© 2014, minimus. All rights reserved.