Competitor Research and Analysis

Competitor research and analysis may seem like a copycat activity, but it is not (at least
not entirely). It is about understanding what your competitors are doing. It is about
examining their keyword and linking strategies while realizing their current strengths
and weaknesses. The bottom line is that you are trying to understand what is making
your competitors rank.
This activity may comprise elements of emulation, but what you are really trying to do
is be better than your competition. Being better (in a general sense) means providing a
site with more value and better perception. In an SEO sense, it means understanding
all the things that make your competitors rank.
When learning about your competition, it is good to examine their past and present
activities, as well as implement ways to track their future activities. Although many
tools are available for you to use to learn about your competition, for most of your work
you can get by with the free tools that are available. This chapter emphasizes the free
tools and research that you can use in your work.

Finding Your Competition
Before you can analyze your competitors, you need to know who your competitors are.
How do you find your biggest competitors? One way to do this is to find sites that rank
for your targeted keywords. The sites that sell or provide products and services similar
to yours are your competitors.
There is a catch if you’re relying only on keywords, though. How do you know whether
you are targeting the right keywords? What if you miss important keywords? You may
be starting off in the wrong direction. This makes it all the more important to do your
keyword research properly. No tool or activity will ever be perfect. You have to start
somewhere.

Link Building

There are countless opportunities for link building. Everything starts on your site. Your
site should make it easy and intuitive for anyone wanting to link to it. To increase your
chances of people linking to your site, you need to provide something of value.
Basic Elements
The following subsections talk about the rudimentary elements that all sites need to
consider.
Take out the guesswork
Take out the guesswork for your web visitors by providing the HTML code fragment(s)
for people to link to your site. Create “Link to Us” and “Tell a Friend” links. Most CMS
software includes prebuilt forms for handling these simple concepts.

Run a daily, weekly, or monthly email newsletter
Running your own newsletter provides several benefits. First, you get to remind your
existing visitors of your new offerings, whether it is content, products, or services. Plus,
the recipients of your newsletter are likely to forward it to people they know if they find
your newsletter interesting.

Provide registered services
Many sites offer free and members-only content. This model offers several benefits. If
your free content is already great, many of your visitors will also be interested in your
members-only content. The idea is that the content that is provided to members only
is of even greater quality than the public content. Many sites charge for members-only
content. Providing registered services helps you build up the email lists that you can

JavaScript getElementById

getElementById() is a method of document object, it gets the tag element with the value "id" in its ID attribute.

To reference in a JS script to a HTML tag through its ID, use the following syntax:

    document.getElementById("id")

So even though the Internet Explorer JavaScript engine uses a mark-and-sweep
implementation, any COM objects that are accessed in JavaScript still use reference counting,
meaning circular references are still a problem when COM objects are involved. The following
simple example demonstrates a circular reference with a COM object:

var element = document.getElementById(“some_element”);
var myObject = new Object();
myObject.element = element;
element.someObject = myObject;

This example sets up a circular reference between a DOM element (element) and a native JavaScript
object (myObject). The myObject variable has a property called element that points to element,
and the element variable has a property called someObject that points back to myObject. Because
of this circular reference, the memory for the DOM element will never be reclaimed even if it is
removed from the page.

<script type="text/javascript">
function testEmpty(){
 var myTextField = document.getElementById('myTxt');
 if(myTxtField.value != "")
  alert("entered: " + myTxtField.value)
 else
  alert("please enter some text?")  
}
</script>
<input type='text' id='myTxt' />
<input type='button' onclick='testEmpty()' value='Checked' />

The argument that getElementById requires is the id of the HTML element you wish to utilize.

JavaScript Objects

Each Object instance has the following properties and methods:
constructor — The function that was used to create the object. In the previous example,
the constructor is the Object() function.

hasOwnProperty(propertyName) — Indicates if the given property exists on the object
instance (not on the prototype). The property name must be specifi ed as a string (for
example, dataObj.hasOwnProperty(“name”)).

isPrototypeOf(object) — Determines if the object is a prototype of another object.

propertyIsEnumerable(propertyName) — Indicates if the given property can be
enumerated using the for-in statement . As with
hasOwnProperty(), the property name must be a string.

toLocaleString() — Returns a string representation of the object that is appropriate for
the locale of execution environment.

toString() — Returns a string representation of the object.

valueOf() — Returns a string, number, or Boolean equivalent of the object. It often
returns the same value as toString().


A new instance of an object:

dataObj=new Object();

dataObj.firstname="Jonti";
dataObj.lastname="Leff";
dataObj.age=40;
dataObj.eyecolor="red";


JavaScript and HTML DOM

WORKING WITH THE DOM

In many cases, working with the DOM is fairly straightforward, making it easy to re-create with
JavaScript what normally would be created using HTML code.


 
Dynamic Scripts
The <script> element is used to insert JavaScript code into the page, either using by the src attribute
to include an external fi le or by including text inside the element itself. Dynamic scripts are those
that don’t exist when the page is loaded but are included later by using the DOM. As with the
HTML element, there are two ways to do this: pulling in an external fi le or inserting text directly.
Dynamically loading an external JavaScript fi le works as you would expect. Consider the following
<script> element:

<script type=”text/javascript” src=”client.js”></script>
This <script> element includes the text for the Chapter 9 client-detection script. The DOM code to
create this node is as follows:
var script = document.createElement(“script”);
script.type = “text/javascript”;
script.src = “client.js”;
document.body.appendChild(script);

JavaScript values, variables

If you try to declare a variable that already exists, JavaScript will treat it as a simple assignment statement and assign any new value in the declaration statement to the variable. If the duplicate declaration has no assignment, then nothing happens. If you try to assign a value to a non-existent variable, JavaScript will create the variable for you.

<script type="text/javascript">
//Commented lines starting with the double


//First we will declare a few variables
//and assign values to them


myTxt = "Do IT";
mynum =13;
//Note that myTxt is a string and mynum is numeric.

//Next we will display these to the user.

document.write(myTxt);

//To concatenate strings in JavaScript, use the '+' operator 
document.write("My favourite number is "+ mynum);
</script>

Include Inline JavaScript code

To include inline JavaScript code, place JavaScript code inside the <script> element directly, as
follows:
<script type=”text/javascript”>
function sayHi(){
alert(“Hi!”);
}
</script>

When using inline JavaScript code, keep in mind that you cannot have the string “</script>” anywhere
in your code. For example, the following code causes an error when loaded into a browser:
<script type=”text/javascript”>
function sayScript(){
alert(“</script>”);
}
</script>

Because of the way that inline scripts are parsed, the browser sees the string “</script>” as if it
were the closing </script> tag. This problem can be avoided easily by escaping the “/” character,
as in this example:
<script type=”text/javascript”>
function sayScript(){
alert(“<\/script>”);
}
</script>

What Is JavaScript

What Is JavaScript? — Explains the origins of JavaScript: where it came from, how it
evolved, and what it is today. Concepts introduced include the relationship between
JavaScript and ECMAScript, the Document Object Model (DOM), and the Browser
Object Model (BOM). A discussion of the relevant standards from the European Computer
Manufacturer’s Association (ECMA) and the World Wide Web Consortium (W3C) is also
included.

Considered the JavaScript expert by many people in the development community, author Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation. Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables.

Robots Meta Tag

Not everyone has access to their web server, but they still want to have control over how crawlers
behave on their web site. If you’re one of those, you can still control the crawlers that come to your
site. Instead of using the robots.txt file, you use a robots meta tag to make your preferences known
to the crawlers.

The robots meta tag is a small piece of HTML code that is inserted into the <HEAD> tag of your
web site and it works generally in the same manner that the robots.txt file does. You include your
instructions for crawlers inside the tags. The following example shows you how your robots meta

tag might look:
<html>
<head>
<meta name=”robots” content=”noindex, nofollow”>
<meta name=”description” content=”page description.”>
<title>
Web Site Title
</title>
</head>
<body>

This bit of HTML tells crawlers not to index the content on the site and not to follow the links on
the site. Of course, that might not be exactly what you had in mind. You can also use several other
robots meta tags for combinations of following, not following, indexing, and not indexing:
<meta name=”robots” content=”index,follow”>
<meta name=”robots” content=”noindex,follow”>

Key Factors Effecting Link Quality

According to SEO convention and the information gleaned from the Google patents, there
are a number of factors affecting the quality of your inbound links.

Link Density
Links from pages with fewer outbound links have more influence than from pages where
there are huge numbers of links – see FFAs. Additional outbound links dilute the value of
existing links on a page. My suggestion is to accept links from pages with no more than
10 to 12 links. Avoid pages with 20+ external links.

Site and Page Relevance
A link from a site and page carrying similar content would carry more influence than
from a site without the similar content.

Google Page Rank
For Google ranking purposes a link from a high Page Rank site has even greater
influence. A link from a PR 6+ site is extremely valuable. At the other extreme, I suggest
you are prudent when exchanging links with sites of a PR of zero. The PR0 category
contains a number of banned sites.

Anchor Text
Anchor text is the text that contains or sits alongside a link. This text provides additional
relevance to the quality of a link. Anchor text is written in HTML. On-screen part of the
text shows up as highlighted (usually coloured) or underlined type and part in normal
type. The anchor text for your site could be written in HTML code as follows:
<a href="http://www.yoursite.com"> Your Site Title </a> - A short description of what
you do. <BR>


Link Age
A long established link is deemed by Google to have more value than a recent link. A
rapid build up in links may also be deemed spam. However Google apparently makes an
allowance for a rapid build-up of links generated by news stories.