Monday, 23 May 2011

Variables in JavaScript




*Variable: Variable is a name memory location used to store some values. Variables are mainly divided into two parts.
*1.Global Variable: In variable declaration in the global location we can access the global variable from any location within the script.
Global variables are destroyed when you close the page. If you declare a variable, without using "var", the variable always becomes GLOBAL.

*Local Variable : Variable declaration within the function. The accessible of scope from local variable is that function only. In variable declaration within the function without var is global variable.
You can have local variables with the same name in different functions, because local variables are only recognized by the function in which they are declared. Local variables are destroyed when you exit the function. You will learn more about functions in a later chapter of this tutorial.

Sample Java Script                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
<script>
var show=100;
function fun1()
var x=100;
var y=200;
z=300
fun2()
}
function fun2()
{
alert(z)
}
</script>
<input type="button" value="click" onClick="fun1()">

Sunday, 22 May 2011

Text Dancing JavaScript


Copy The Below JavaScript code in Notepad and save the file with .html extension. And You are Done. Open The file with browser and see the magic. 




<html> 
<head> 
<title>Don't use Frames</title> 
<style type="text/css"> 
body{background:#FFF;color:#333;font-family:Georgia;margin:0;overflow:hidden;padding:0;text-align:center;}
h1{font-size:250%;margin:5em 0;}
h1 span{padding:0 3px;position:relative;}
a{color:#666;}
a:hover{color:#00F;}
address{bottom:10px;font-style:normal;position:absolute;right:10px;text-align:right;}
</style> 
<script type="text/javascript"> 

var n = 0;
function animate()
{
var e = document.getElementsByTagName("SPAN");
for (var i = e.length - 1; i >= 0; i--)
{
var s = Math.sin(n - i) * 10;
var t = Math.cos(n - i) * 10;
e[i].style.top = Math.round(s) + "px";
e[i].style.left = Math.round(t) + "px";
var c = 6 - Math.sin(n - i + 2) * 5;
e[i].style.textShadow = "#999 " + Math.round(c / 2) + "px " + Math.round(c) + "px 4px";
}
n += 0.2;
}
function start()
{
window.setInterval(animate, 20);
}

</script> 
</head> 
<body onload="start()"> 

<table cellpadding="0" cellspasing="0" height="100%" width="100%"> 
<tr> 
<td align="center"> 

<h1><span>D</span><span>o</span><span>n</span><span>'t</span><span> u</span><span>s</span><span>e</span><span> F</span><span>r</span><span>a</span><span>m</span><span>e</span><span>s.</span></h1> 

</td> 
</tr> 
</table> 

</body> 
</html>


If you Like the Post please feel free to comment . 

SEO for Blogs Blogger Beginners to My Websites




Page SEO optimization is a technique to bring your site on to the top pages of search engines so If you want to SEO for blogs then you can't be ignore on page seo optimization. What is on page optimization for blogs? Basically on page seo optimization are the techniques of which you have to do by your self for your blogs such as creating content, domain name, research keywords, meta tags, page headings,  keyword density, internal linking.. I will discuss these in the following posts. Since on page seo optimization is totally depend upon you so at least you can done your work in the write manner to giving a reputation to your blog. Before reading it I would suggest to you that firstly read SEO for blogs/beginners for how to completely done seo for blogs. This post is about on page optimization which is the one step for seo for begginers. So lets start the points for your on page optimization.


**** Before starting on page optimization I recommend that read What is SEO For Blogs and how many methods required for completing SEO for any blog. 

How to Optimize Blogs by On Page Optimization Techniques

Research Keywords :

Keyword research is the first step to starting the long term blogging career and also to start the On page Optimization because if you don't know about your niche keywords then you never generate traffic to your blogs as your niche should be deserve without researching your keywords and also If you are in the planning to monetize your blogs with some advertising companies such as Google Adsense then you must be research high targeted keywords for generate decent amount. The idea is simple because if you don't know the keywords that people searches mostly related to your niche then how search engine let you bring to the top position if you don't have any optimized page for that corresponding keyword.

     There are many software to researching the keywords of which mostly used by users such as Word Tracker which is a firefox plugin and you can use it in the browser while you are writing your post just enter your keywords then it will give you the suggestion of your related keywords which are mostly searches by the users.

      Mostly I am using google own keyword Tool just type your keyword phrases or keyword and search you will get lot of suggestion you can sort it by globally searches or locally search and noted down your keywords to any safe area.

Domain Name :

If you want to be stay in blogging for long term then I would suggest you that purchase your own domain name because if you used any free domain such as yourblogname.blogspot.com and after some months you want to be purchase your own domain name then you know how hard to increase your audience and by changing the domain name then you have to start working from the starting. I highly recommended that include your main keywords in your domain name because search engines gives priority to sites who have keyword also in domain name. If possible then register your domain name for a long term. The longer the registration the most trusted by search engines because many spam sites have short registration and longer the registration will indicate to search engines that you are building your site for long period.

Blog Title & Post Title :

Blog title is main factor for on page seo optimization. You can find it by going to your source code your blog title will be between <title> Your Blog Title </title>. So for creating your home page blog title make sure to include your main keywords in your blog title and don't make it longer or your blog title should be upto 70 words including spaces and not more than 70 words if you do that then your blog title will going to be overloaded and your blog title looks very spoil in search engine pages and your CTR will automatically decreases. You can take a snap shot of overloading in Fig. 1.1 into my previous post Swap Title in Blogger . This is also applied for post titles and also here not include more than 70 words in post title. Try to include your main keywords in the beginning of your titles because search engines gives priority from left to right. Don't use same title for different pages.

      If you blog is hosted on google blogger platform then by default your post tile not be search engine optimized because you will see your post title as "BLOG TITLE : POST TITLE" so you can see your blog home page title will be on the left side and your main page on which you created content for your targeted keywords is in right side and search engine will gives priority to your blog title not on post title so bring your post title on left side and remove your blog title on post pages because of 70 words criteria so that you can include your some keywords on post title too. so fixing this bugs read Change Post Title for SEO. 

Meta Tags :

In On page seo optimization some webmasters says that search engines has been changed the algorithm and they did not use meta tags for search queries and it is also true if you don't have any meta description of your blog then google will generate automatically a description and shows it in the search result page. Basically how google find the description automatically the idea is simple if user search the query and then google finds a piece of 160 words from your posts which contains mostly the queries related term. So my question is that why you want to give extra work to google for finding the description the idea is simple create a good description which contains your keywords and if your selected description has best 160 words from your entire post.then google will show it. You can see meta tags as description and keywords as in your source code if you have,

<META NAME="description" content="Your Description Here"> 
<META NAME="Keywords" content="Your Keywords Here">

meta keywords is not important for seo in these days because many users can stuffed with keywords so it is now not considered by major search engines and if you do that then no negative effect so add it properly because doing something is better than nothing.

Make sure your meta tags must be unique for every pages of your blog. Never use the same meta tags for your pages it could be negative effect in seo for your blog. If your blog is hosted on blogger then read this post  Add different meta tags for post, static, archive, home pages of blogger.



Page Headings H1, H2, H3.. H6 :

Headings have major roles in on page seo optimization.  you can see your headings in your source code it look like <h1> .. </h1>. Like a book if you read a book then first look at the name of the book as blog title have and then go to inside the book and you would like to see some headings before reading the book. This is also true for search engines. search engines look at your headings and H1 heading tag is more powerful in 

SEO than H2 heading tag and and similarly, H1 < H2 < H3 < H4 < H5 < H6

Since H1 heading tag is most powerful among all heading tags so it doesn't means that you used H1 heading tags many times in the same post. Never do that if you do this then it could be negative effect in SEO for your blog. Only use one and unique H1 heading tag for your every pages of your blogs and then you can use H2 heading tags more than 1 which are subheadings and similarly for H3. I am mostly use upto H3 heading tags. You can suppose H1 heading tag is like your country and H2 heading tag like your state of your country and H3 heading tag like your cities in your state of your country and similarly you can expand it. 


Page Content :

There is no doubt that content is the king for search engine optimization but your content must be have your targeted keywords as you find in your keyword tool see step 1. Try to use those keywords in the content and optimize your content page for some specific phrases means one or two but not enough phrases because if you do that then search engine will confused that for which phrases we have to bring this page into search pages. So in simple way use your suggested keywords by keywords tool  in to your post page it will increase the chances for finding the traffic and optimized it with primary keyword which is the most searched keyword in your keyword tool and include your primary keyword in to the first paragraph of your post but never stuffed. And the second largest searched term you can use it by secondary keywords and use it in your content but be sure the quantity of your secondary keyword should not be more than primary keyword. 

Keyword Density :

First thing you must be know that you are writing about your audience and not for search engines. So write your content normally and never stuffed your article by filling a lot keywords in your content. Basically your keyword density should be between 1% - 4% if your keyword density be 6% or 8% then your could be banned by major search engines. Keyword density means suppose you write 100 words and use 'SEO' 2 times, then your keyword density will be 2%. You can check for keyword phrases also. Use this tool for Keyword Density Checker. 

Internal Linking :

Internal links means put your existing post URL into the post which is related to the existing one and for create a link use Anchor Text with your keywords related to post of which you want to add link because in the content area the linking is most trusted by the search engines. Being links in sidebar or in footer it is also in benefit but in the content area it is more powerful in SEO for on page optimization.

URL Structure :

Also search engines look at the URL of the post for keywords if they find keywords in the URL they could give some priority. So try to use your keywords in your URL structure which will  be after your your domain name. For example could you see "On, page, optimization, SEO" in my URL structure in your browser URL field.

Updating Content :

The more you update your content the more traffic you get and the more indexing by search engines and the more probability to popular so try to write articles in your blogs at least one in a day. if not then at least two article in a week. Update content in your blogs is doesn't mean that go to your edit post and cut some part and add some part and publish it. It means you want to fool search engines but search engines not like a fool at least the current season.

Related Niche Brands :

It is a fact that if you want to read mathematics and you know two persons in which one knows mathematics, physics, chemistry,  Bio, Social Science, Programming Languages, .. and much more. but on the other hand the other person only knows Mathematics so I have a question to you that with what person you want to read the first who knows mostly all things or the second one who knows the thing which you want. I would not say what you think but in my case I will prefer the second person who knows only mathematics because no one in the world exist who experts in all the field. Similarly Search engines mostly likes the blogs which related to a particular niche and all the post of the blog are related to that niche. For example I could not add any category in this blog related to 'health' because my niche is Tips & Tricks and based on SEO Technology.

Image Optimization :

I would not say about image optimization here because I have already created a post related to image search engine optimization with brief explanation. You can read it via SEO Optimization for Images.

Useful Gadgets :

In your sidebars put recent post gadget (for linking each other pages) and don't forget to add gadget which contains the categories of your content. if you are a blogger account then it is know as Blog Archive widget. I highly recommended you to add related post gadgets below every post pages but above the comment box. You can use Linkwithin for related post gadget with thumbnails. 

Outbound Links :

Basically outbound links are links which are points to other sites from your site. Keep in mind that for your every page your outbound links should not be more than 100. If possible then keep the links which are related to your niche, which will be beneficial for both your visitors and for search engines. But why for search engines? It would leave my visitors to linked site. Is outbound links help for indexing? I really have not much idea about that but think if you are writing an article and you know the article which is already published and mostly related to your own and if you link your article to that already published post so your visitors can read more information about your article for linking by you than not outbound link. Readers sure Love You (as a friend lol!) and back if they want other info. You can read more about Do Outbound Links matter in SEO.


Above are the factors what I measure through our SEO for my blog for On page optimization if you follow these steps then I am sure your pages will be optimized but game is not over because you have been done your batting and now you have to do bowling and in this case you have to some player for your fielding and you can play with more than 11 players( Ok don't take pressure on your knee. lol!). now you have to  do Off page SEO Optimization for getting the benefits for you On Page SEO Optimization, or vice versa. click the following link.














Importance Of Outbound Links SEO





Craig Harper asks – Thanks to the tips provided by yourself, Yaro, and Aaron Wall I’ve just managed to finally crack into the top ten on Google for my keywords ‘motivational speaker’. I read over on Yaro’s site here about the importance of outbound links being targeted at your niche. In terms of SEO I know there is a lot of emphasis placed on the importance of inbound links but I would like your thoughts on the importance of outbound links and the websites that you outwardly linked to.

Interesting question Craig. Let me answer this question about outbound links but taking us in three directions
1. SEO – You’re right, one of the common pieces of advice that SEO types give is that relevant outbound links to quality sites can actually help your own performance in the search engines.

I’m no SEO expert but all I can really say on this is that some SEOs that I know and respect argue good cases for this and that when I’ve launched blogs it is something that I’ve always done. I don’t know how much of an impact that it has had on those sites – but they do tend to do well in search engines.

My suspicion is that SE’s like Google and Yahoo! have hundreds of factors that they rank a site by and that outbound links is probably one of them – although not one of the ones that they give most weight to (ie it’s not as important as your title tags or the inbound links pointing at your blog).

The only guidelines that I’d recommend in outbound links from a purely SEO perspective (and there are others to consider below) are:
a. not too many links (apparently too many outbound links can be frowned upon by SE’s)

b. keep them relevant (link to other sites/pages that are on a similar topic to you)

c. use appropriate keywords as anchor text (the words you use as the link can help both you and the site you’re linking to with SEs)

d. high ranking sites (some SEOs argue that if you link to highly ranking sites for the keywords that you’re after that it will have more impact).

Note: these tips are purely speaking from an SEO perspective. My own approach with SEO is to know the principles but not let them dominate my blogging. As a result, the only two principles from these four that I do regularly are b and c because I can do them without impacting the ultimate goals for my blog.

So for me – the SEO benefits of outbound links are something I believe in but they are also something I don’t get to worked up about.
2. Reader Satisfaction – the impact that links have upon readers is more important to me than SEO.

Here at ProBlogger I link to a lot of other sites. In fact SEO experts tell me I link out too much (from a purely SEO perspective).
The main reason that I link out so much is purely that I want to give my readership as much quality information on my topic as I can. If I see something that someone’s written on my topic that says something useful then the chances are that I’ll link to it (either as a simple link in one of my speedlinking posts or as a longer post with some of my own thoughts attached).

Some argue that linking out to other sites isn’t worth doing because you drive people away from your blog – my theory is that if I send them to useful content often enough that they’ll keep coming back for more.

Keep in mind also that too many links can actually decrease reader satisfaction – if they are not relevant or useful links.
3. Other Reasons to Link - there are other reasons that it can be useful to link out from your blog including these two:
building relationships with other bloggers/webmasters – linking out and sending traffic to other sites is one way to get on the radar of their owners

perceived expertise – showing your readers that you have your finger on the pulse of a niche by showing what other sites are doing can increase their perception of you as someone who knows what they’re talking about.
I’m sure readers will come up with a lot more reasons to link out – so over to the ProBlogger Community for their response…

Images Search Engine Optimization | Google SEO for Images



Image Search Engine Optimization SEO or you can say seo from google image search is a technique to getting some decent traffic from major search engines through by image search. So Google seo for images is a good thinking to increase your visitors for your site, just you need to do some extra work with your images for google seo for images.This blog have some decent traffic from google image search engine. You can take a look for my search engine queries in google images seo. Go to Google Image Search and search with query "mohammad shadab" you will get many result from my blog in the first page of google image search engine. Below is the preview of my result at the time of creating this post,

All the green check sign represented these are the images from my blogs and these are the first pages result only and if you scroll the result then you can find more results from my blog.
Now how did I optimize it so that my images are in the top result of google seo in image search. I am sharing some tips on optimization images for seo this will definitely help you a lot for yous images in seo.

Google SEO for Images | How to Optimize Images for Search Engines


You don't need to have any special knowledge for google seo for images just you need to put your images into your blogs or websites with the proper way. Below are some points just follow it for seo for images,

1.) Try to minimize your images size for fast loading to user's browser. Because if you have many images with high size then it will be difficult to fully load your blog or website within short period of time means it will take many times to load your blogs. It will impact the user's experience with your blogs or websites so user will hesitate to open your other posts and your page views will down due to your down loading time. So avoid it however it is not a part of SEO but it is better to avoid it.

2.) Before uploading your images concerns with your post in which you want to add this image and what is all about your post search your targeted keywords for that post and also rename your image with the name in which your keywords are included. This will give higher priority to major search engines as Google for SEO Images.Suppose if I want to use any image for my this post then I will rename my image with "google seo for image" or " image search optimization" or " images for seo".
*Don't use so many words to rename it. 

    Now if you upload your image into your post then for showing your images into your blogs or websites the below code is enough and it will be look like,

<img src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg"/>

3.) Search engines searching content because they have written by words and search engines can't see the images because they have no eyes. So search engines only crawl the things which are written. So in the case of images it is a good idea that you tell more about your images by associated content with your image. We called it as alt attribute in img tag. So including your main phrases in this tag and include your keywords here. For example if I upload any image in this post then we can write in alt attribute as "SEO for images" or "image search engine optimization" or "Google image optimization".

Then your HTML code for image will convert into,

<img src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg" alt="image search engine optimization"/>

4.) It is better to include height and width attributes in your image html code. If you upload your image into your blogger then you don't need to add these attributes just you need to change your S1600 or S320 or S400 or S and any no. this no. will be your width and height will automatically adjust. for more info to uploading your images in blogger or to understand (S any integer) click on High Resolution Images upload in Blogger. If you hosted your images in other than blogger then your HTML code will convert into,

<img src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg" alt="image search engine optimization" height="300" width="400"/>

5.) You can use the title attribute in your img tag. If you use of it is that if some one hover your image then they will see a title box for information of your image however the title attribute has no more power in SEO but doing something is always better than nothing. for live example just go to the top of this post and bring your cursor on the first image inside this post you will see in the title box "Google Image SEO Strategy". Then your HTML code will convert into,

<img src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg" alt="image search engine optimization" height="300" width="400" title="Google Image SEO Strategy"/>

6.) Now if your image is place outside from your content then search engines will give normal priority so it is better to placed your images inside your content which includes your main keyword. So how to include your images in your content just you need to use float property in div tag. So your HTML code for image will convert into,

<div style="float: right; margin: 5px">
<img src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg" alt="image search engine optimization" height="300" width="400" title="Google Image SEO Strategy"/>
</div>

So in that case your image will be in the right side and your content will cover it from left and the bottom area. you can check a live preview of float: right property just go to the end of this post you will see About the author box in which notice that my image is in right and content is in left and then go to Google Image Search and search with "mohammad shadab" hope you will find that image in the front page of Google Image Search Engine.
Now if you want your image in left and your content in right then simply change float: right to float:left in the above code.

7.) The keywords which are the min. distance from the image, high impact on image search engine optimization by these keywords so we have to write keywords at the min. distance from our image. So how about caption? Caption is the bottom content line area(not the bottom due to content)of image so it is the very near distance of words and major search engines impact high by this caption on images.You can see my first image of this post the caption is that "Google SEO for Images". So how to write it?
For Blogger: It is very easy just upload your image in your blogger post and then click on that image then you will see an option for "Add caption" so click this option and write your caption.
For other blogs or websites: If you have also direct method to add your caption then use it and if not then you can add your caption by HTML directly. Below is the HTML of images with caption. So your HTML code for image will convert into, that is the final code of your optimize Image,

<table cellpadding="0" cellspacing="0" style="margin-left: auto; margin-right: auto;"><tbody>
<tr><td style="text-align: center;"><img alt="google seo for images" src="Your-Blog-Domain-Name/images/google+seo+for+image.jpg" alt="image search engine optimization" height="300" width="400"  title="Google  SEO Image Strategy" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td style="text-align: center; font-size: 10px">Enter Your Caption Here</td></tr>
</tbody></table>

Just replace your image url and your caption in the above code and set your width and your height of your image and use your title and alt attribute. 

If you done all the requirement which I listed above I am sure you will get some amount of traffic from image search optimization. If you have any doubt then feel free to leave your comment here.

You done!