Assalamo alaicom, 我想修改以下脚本以使其成为AMP友好的,以便我可以在我的博客模板中使用它们。 我该怎么办才能使它对AMP友好?
<div id='adsense-mohamed'><data:post.body/></div>
<div id='adsense-algandy'>
Adsense CODe HERe
</div>
<script type='text/javascript'>
function insertAfter(addition, target) {
var parent = target.parentNode;
if (parent.lastChild == target) {
parent.appendChild(addition);
} else {
parent.insertBefore(addition, target.nextSibling);
}
}
var adscont = document.getElementById( & quot; adsense - algandy & quot;);
var target = document.getElementById( & quot; adsense - mohamed & quot;);
var linebreak = target.getElementsByTagName( & quot; br & quot;);
if (linebreak.length & gt; 0) {
insertAfter(adscont, linebreak[1]);
}
</script>
&#13;
第二个脚本: