1if(typeof BX == 'function'){ 2 BX.addCustomEvent('onAjaxSuccess', function(json, params){ 3 if(typeof json == 'object' && json != null && typeof params == 'object' && params != null){ 4 if(typeof json.WD_SEO_META == 'object'){ 5 if(params.url.indexOf('ajax=y') != -1){ 6 if(typeof json.WD_SEO_META.H1 == 'string'){ 7 document.querySelectorAll('h1').forEach(function(h1){ 8 h1.innerHTML = json.WD_SEO_META.H1; 9 }); 10 } 11 if(typeof json.WD_SEO_META.TITLE == 'string'){ 12 let wdSeoDivTitleTmp = document.createElement('div'); 13 wdSeoDivTitleTmp.innerHTML = json.WD_SEO_META.TITLE; 14 document.title = wdSeoDivTitleTmp.innerText; 15 } 16 if(typeof json.WD_SEO_META.KEYWORDS == 'string'){ 17 document.querySelectorAll('meta[name="keywords"]').forEach(function(meta){ 18 meta.content = json.WD_SEO_META.KEYWORDS; 19 }); 20 } 21 if(typeof json.WD_SEO_META.DESCRIPTION == 'string'){ 22 document.querySelectorAll('meta[name="description"]').forEach(function(meta){ 23 meta.content = json.WD_SEO_META.DESCRIPTION; 24 }); 25 } 26 if(typeof window.wdSeoRefreshSeoVisual == 'function'){ 27 window.wdSeoRefreshSeoVisual(); 28 } 29 if(typeof json.WD_SEO_META.REPLACE_URL == 'boolean'){ 30 if(typeof json.WD_SEO_META.URL == 'string' && json.WD_SEO_META.URL.length){ 31 history.replaceState({}, document.title, json.WD_SEO_META.URL); 32 } 33 } 34 if(typeof json.WD_SEO_META.REPLACE_SEO_LINKS == 'boolean'){ 35 if(json.WD_SEO_META.REPLACE_SEO_LINKS === true){ 36 let 37 href, 38 urlEncoded = json.WD_SEO_META.URL, 39 urlDecoded = decodeURIComponent(json.WD_SEO_META.URL); 40 wdSeoLinks = document.querySelectorAll('[data-webdebug-seo-link]'); 41 for(let i in wdSeoLinks){ 42 if(wdSeoLinks.hasOwnProperty(i)){ 43 for(let j in wdSeoLinks[i].childNodes){ 44 if(wdSeoLinks[i].childNodes[j].tagName == 'A'){ 45 href = wdSeoLinks[i].childNodes[j].getAttribute('href'); 46 wdSeoLinks[i].setAttribute('data-selected', href == urlDecoded ? 'Y' : 'N'); 47 } 48 } 49 } 50 } 51 } 52 } 53 } 54 } 55 } 56 }); 57}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.