Home>Support>Code displaying in the header

Code displaying in the header

Hi, I’m not 100% sure if this is an issue with the vantage theme, but I switched to other themes and I don’t notice the problem.

It seems that there is a script that’s being inserted between the html tag for the logo in the header.

This is the script.

//<![CDATA[
(function(){var g=this,h=function(b,d){var a=b.split("."),c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===d?c[e]?c=c[e]:c=c[e]={}:c[e]=d};var l=function(b){var d=b.length;if(0<d){for(var a=Array(d),c=0;c=d.offsetWidth&&0>=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+(“pageYOffset”in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+(“pageXOffset”in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+”,”+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a<=b.e.height&&c<=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});var r=function(b){b.b={};for(var d=["IMG","INPUT"],a=[],c=0;c<d.length;++c)a=a.concat(l(document.getElementsByTagName(d[c])));if(0!=a.length&&a[0].getBoundingClientRect){for(c=0;d=a[c];++c)q(b,d);a="oh="+b.i;b.c&&(a+="&n="+b.c);if(d=0!=b.a.length)for(a+="&ci="+encodeURIComponent(b.a[0]),c=1;c=a.length+e.length&&(a+=e)}b.g&&(e=”&rd=”+encodeURIComponent(JSON.stringify(s())),131072>=a.length+e.length&&(a+=e),d=!0);t=a;if(d){c=b.f;b=b.h;var f;if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject(“Msxml2.XMLHTTP”)}catch(k){try{f=new ActiveXObject(“Microsoft.XMLHTTP”)}catch(u){}}f&&(f.open(“POST”,c+(-1==c.indexOf(“?”)?”?”:”&”)+”url=”+encodeURIComponent(b)),f.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded”),f.send(a))}}},s=function(){var b={},d=document.getElementsByTagName(“IMG”);if(0==d.length)return{};var a=d[0];if(!(“naturalWidth”in a&&”naturalHeight”in a))return{};for(var c=0;a=d[c];++c){var e=a.getAttribute(“pagespeed_url_hash”);e&&(!(e in b)&&0<a.width&&0<a.height&&0<a.naturalWidth&&0=b[e].k&&a.height>=b[e].j)&&(b[e]={rw:a.width,rh:a.height,ow:a.naturalWidth,oh:a.naturalHeight})}return b},t=””;h(“pagespeed.CriticalImages.getBeaconData”,function(){return t});h(“pagespeed.CriticalImages.Run”,function(b,d,a,c,e,f){var k=new p(b,d,a,e,f);n=k;c&&m(function(){window.setTimeout(function(){r(k)},0)})});})();pagespeed.CriticalImages.Run(‘/mod_pagespeed_beacon’,’http://www.jacobwilliamsondesign.com/blog/’,’l8PuqRhht8′,true,false,’FNn9dX2Uw_A’);
//]]>

URL: http://www.jacobwilliamsondesign.com/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 6 months ago Daniel
    Hi, I Work Here

    Hi Jacob

    I have just looked at your site and the error you are highlighting is no longer visible. Did you have it solved?

    Kindly let me know.

  2. 9 years, 6 months ago Jacob Williamson

    hi, sometimes it goes away and comes back, check other pages. It’s showing up randomly. I think I need to move the script into the footer but I don’t know how to do this. The script is displaying between the image tag in the header where the logo is located.

  3. 9 years, 6 months ago Daniel
    Hi, I Work Here

    Hi Jacob

    I have finally managed to capture when this is appearing. Try this plugin

    Link : https://wordpress.org/plugins/header-and-footer-scripts/

    Let me know if that works out for you

    Cheers

  4. 9 years, 6 months ago Jacob Williamson

    Unfortunately, no. This didn’t seem to work.

  5. 9 years, 6 months ago Daniel
    Hi, I Work Here

    Hi Jacob,

    Can you try disabling all non-SiteOrigin plugins and see if this fixes the issue? If it does fix the issue, then try re-enabling your plugins one by one until the issue comes back. This procedure will help diagnose if a plugin is causing the issue.

    Let me know the outcome after this.

  6. 9 years, 6 months ago Andrew Misplon
    Hi, I Work Here

    Hi Jacob

    If you’re not inserting that script manually then you can de-activate and remove the Header and Footer Scripts plugin, no need for that.

    If you’re not doing this yourself it means a plugin is. So running through the steps Addo suggested above, would be the way forward.

  7. 9 years, 6 months ago Jacob Williamson

    Hi, the problem has been resolved, Sorry for not updating. I had someone else take a look and this is what they said.

    Looks like the Vantage theme you have was generating the header through a PHP script. Something in that script was triggering an error with PageSpeed that wouldn’t let it parse the data properly. I’ve made some tweaks and it seems to be working fine now.

  8. 9 years, 6 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad you were able to resolve and find the problem. Thanks for updating us.

    All the best.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More