JQuery block loading

It's great to have lots of content. Sometimes you need even content from offsite. If you link to an offsite source that can drop your page rank, feeding page rank to the source (the "Articlebase effect" wherein a site full of mediocre articles gets all of the traffic). You cannot serve two versions of your site (one for Google to gain favour; one for real people). Google will de-index your site in response. Google is an 800-lb. gorilla: on site I work with, they are responsible for about 50% of the page views. The real users make up a small minority of the page views. You need to cushion your processing to accomodate this huge amount of non-human usage. If you could serve less content that could mean less database access-- less work to gather the page contents. But, you need to give users as much content as possible to hook them. You need to serve the same page to all. But, you can capitalize on the technical limitations of spiders. For a while (eg. ignore this article in you're reading it in the Spring of 2011), search engine spiders are not Javascript/JQuery sensitve. So, you can deliver the same page to all, but use JQuery and Ajax loading to bring in supplemental content. If the content points to offsite links, it may send users away from your site, but it will not contribute to lowering your page rank.

<script type="text/javascript">

window.onload = function() {
$("#ajax_window").load("http://mike.dewolfe.bc.ca/cooking").fadeIn("slow").slideDown('slow')};
</script>


<div id="ajax_window"></div>

The above code is an example of what I may use on my mike.dewolfe.bc.ca site. It leans on the existance of JQuery. The page it calls load into the "ajax_window" DIV. I do have to call a local resource for the sake of simplicity because of XSS safeguards in my browser. Rather than use "document.ready()" a classic way of gauging a page load, I use window.onload(). This is because I subscribe to the Steve Souder tips on High Performance Web Sites: Essential Knowledge for Front-End Engineers and put my script calls at the bottom of the page. The problem with that is that the JQuery library loads late on a page and the function calls in the page that reference it will choke and fail. window.onload() is a basic Javascript function, so it will always be recognized. When the page is loaded, the JQuery functions are present and window.onload() will allow those functions to be called.

Comments