Feedjit is a useful add-on to a website for tracking visitors to your blog. Feedjit shows a little snapshot of when and where each visitor to your site came from. One can easily see visitors from around the world.
However, one difficulty with Feedjit is that it contains a ‘real-time view’ hyperlink to the Feedjit site for traffic statistics. I don’t particularly want this accessible from the front page of my site. I also don’t want the Feedjit advertising to show if I can eliminate it.
How is it done?
Use the Firebug console in Firefox to see the CSS and HTML that was loaded by Feedjit into the browser. This will show that the iframe name was ‘FJIframe’ and the table ID was ‘FJ_Tlist’. This is good, but please understand that this solution is just a hack that is dependent on these coded names. Once Feedjit updates their script or rebuilds their process and changes these names this hack will fail to work.
The first step is to figure out how to edit the table so it appears as we want. Assume for the moment that the Feedjit table has been rendered fully and we are coming in after the fact to fix it up. The function ‘hideFeedjit()’ shown in the code below performs the table row deletions. We must remove the top two rows of advertising and the bottom two rows to get rid of the Feedjit links to the real-time view. We will hide the rows in the table by setting their display style to none so that they take no space.
One difficulty with this solution is that the container div block has already been rendered and sized to fit the full table. When we hide the rows we end up with unused white space at the bottom of the container. To fix this we need to resize our container. This is why we have the named ‘visitor’ div block set up around the Feedjit code. We can resize this object to remove the white space from the missing rows.
The operative test to see if the iframe is loaded is to check if readyState == ‘complete’. This works in Internet Explorer and Firefox version 3.6 or later. But, for some reason Internet Explorer versions prior to version 8 would not identify the iframe object if it was searched for by name.
The last step is to start this whole process once my web page is loaded. We activate the function as soon as it is declared but we know that the page load may not be complete. This is why we check for existance of the iframe and table objects. If they are undefined we simply wait a bit and try again.
This solution is fault tolerant. If it fails to find the required objects or delays in load times occur then the worst thing that will happen is that you will see the uncorrected Feedjit display. We also shut the timing loop down after 100 iterations or 10 seconds to be nice to our web browser. So, as web transfer delays are always possible there is no guarantee that it will hide the Feedjit links all the time, every time.
Good luck! You can see this Feedjit hack operating on the home page of Kisekae World
WordPress Text Widget Contents
Validated in Firefox, Internet Explore 8.0 and later, Chrome, and Safari
Copy this code into a WordPress text widget. Or, if you are not using WordPress or some other content management system then simply insert this code into your web page where you want the Feedjit output to appear. Note, you will have to replace the identified Feedjit script link with your own code. See the Feedjit site.