var search_me = '246_56704'; var scriptElems = document.getElementsByTagName('script'), i=scriptElems.length - 1, curLoc; for (; i; --i) { curLoc = scriptElems[i]; if ('innerText' in curLoc) { if (curLoc.innerText.indexOf(search_me)) break; }else if ('textContent' in curLoc) { if ... READ the POST