Saturday, July 25, 2015

MAKE MONEY WITH INFOLINKS FULL TUTORIAL

MAKE MONEY WITH INFOLINKS FULL TUTORIAL

Infolinks is a CPC ad serving program like Adsense. Its ads are shown in text on your site. When some body click those ads they pay you according to cost of keyword. It is much better after Adsense I recommend to use this. You might take some time to make a regular passive income from Infolinks because it require some great amount of text on your site so in which they can place their ads.

Requirements To Join Infolinks.

  • You must have your own blog or website.
  • Your blog must have at least 10 posts.
  • Blog must be in English.
  • Your blog have at least 50 daily visitors.

How to Join Infolinks Program?- (Earn Money With Infolinks

Step#1. Visit Infolinks.Com and click on Join Us, You can sign in by using your Facebook account. See the picture below.

Fill the given form and click on join. A new page will be open.
Step#2. After filling the form they will provide you a HTML ad code, Copy It.
Infolinks Integration To Your blog

Step#3. Paste the code in the HTML of your site before the </body> tag .
Step#4. After pasting the code your site will be pending for approval.
Step#5. And your site will be approved within 48 hours. The ads will automatically pop up after approval.
Step#6. Once your account is created your are able to log in to your account. Log in o your account by clicking on publisher log in.
Step#7. After successful log in to your account provide all your payment information to your account. It will update and redirect to you your account dashboard. Here you can check your all information about your site and can check earning reports. You can update your payment information and your profile information. You can add multiple sites to your account they will be waited for approval.

How much You Can  Earn From Infolinks ? – Earn Money With Infolinks

There is no limit of earning from Infolinks ads, the limit is only sky. You can earn thousands of dollars from Infolinks ads serving. You only have a good rank and high traffic website or blog. If your blog gains a high traffic there is no doubt to earn a lot from it.

How to Get Paid From Infolinks? – Earn Money With Infolinks

According to the Infolinks TOS, They issue payments no later than 45 days from the end of the month, but the only condition is that your earnings have reached the minimum payout threshold of $50 (PayPal) or $100 if you chose a Bank Wire or Western Union Transfer.
Infolinks offers several other convenient ways for publishers to receive their monthly payments i.e. PayPal, Bank Wire, eCheck, Western Union or Payoneer etc.
You can select your preferred payment method under Payment Settings in your Infolinks account dashboard.
So, there above is some general information about Infolinks, I hope you will get your Infolinks account after following my tips. Share this post with your friends and Remember me in Your Prayers.

Friday, July 24, 2015

EARN ONLINE (GOOGLE ADSENSE)

GOOGLE ADSENSE TUTORIAL.


What is Google Adsense ?
It is a program that you can participate in that lets you put small ads on your webpage, when somone clicks on one of the ads you get some money, the ads are relevant to the content on your website, if your website is about painting cars you might get ads about car paint or books on how to paint cars, google will scan your site and pick up on your content.

What does it cost me ?
Nothing, the program is free.

Do I have to live in the USA to join ? 
No

What should I have before I apply for adsense ?
A working website, not one that is under construction, good content, lets say if I search for how to paint a car, I want to get info on how to do just that and not go off on ten other things with little info and a lot of ads, have at least three to five good articles and some useful links, If you only have one page right now with good content that should be ok, If you get turned down add some pages with content and apply again, remember to try to stick to one topic, that way when google scans your page the ads will be relevant to your site topic.

How much money can I make with adsense ?
It all depends on how much the advertiser pays, It could be ten cents or ten dollars per click, the range is wide and pay's different on all topics, If you have a popular site and a lot of people are clicking the ads you could make hundreds of dollars a day.

Are you ready ?
If you have a site up and running and want to apply for adsense lets do it.

Step-by-Step Guide to Inserting Google Ads

  1. Click "AdSense Setup" in your Google AdSense account. In the page that loads, click "AdSense for Content". From there, you will be led through a series of steps to choose the type of advertisement and customise its size and colours. These options allow you to modify the appearance of the advert so that it blends nicely into your site's design.
    When you have finished customizing, click "Submit and Get Code". AdSense will then give you some HTML code to cut and paste into your web page. Click anywhere inside the box containing the code. The code will be automatically selected. Click your right mouse button and select "Copy" from the menu that appears. This puts the code into your clipboard, so that you can paste into your website in KompoZer.
  2. Run KompoZer if you have not already done so. Open the web page where you want to insert the advertisement.
    Choose a place on your page where the ad is to be inserted. Google does not restrict you on the placement of the ad, so you can put it anywhere you like. Some common places where ads are placed include the top, bottom and side panel of a web page. In general, adverts placed in prominent places (such as those embedded in the middle of an article) tend to attract more attention, and thus earn better.
    I should warn you, however, that "in your face" advertisements, where the adverts have placements that force your visitors to look at them, are also very irritating to many people. For this reason, even though they get better results, I don't use them on thesitewizard.com. You should also weigh the benefits of increased income against the cost of aggravating your visitors when deciding. As a matter of personal pride, I prefer to give my readers a pleasant learning environment rather than bombarding them with ads, but it all depends on your priorities/goals.
    Another thing to watch out for is that Google limits the number of AdSense "units" you can place on a page. Read the Terms of Service for the exact number. Regardless of the number though, it's best not to load your page with too many ad units. If there are too many, your website may look cheap, even if your content is actually of very high quality. (There is no hard and fast rule here. Just check your web page in your browser when you've finished, and try to be impartial when judging your own page.)
  3. Once you have decided on the ad placement, click the spot on the page where the advertisement is to be shown. The blinking text cursor should appear in that spot. Next, click the "Insert" menu followed by the "HTML..." item on the menu that appears.
  4. In the dialog box that is shown, paste the code you copied from Google into the empty space. This can be done by clicking the right mouse button somewhere in the space and selecting "Paste" from the menu that pops up. Your AdSense code will appear in the box. Click the "Insert" button to dismiss the dialog box.
  5. KompoZer does not actually display the advertisement, but indicates you that you have successfully inserted the code by showing one or more yellow "Script" tags in the location where the ad will appear in your real website.
    If you want to insert more than one ad unit into your page, repeat the procedure I provided above. Once you've finished, publish the web page to your site in your usual way.
  6. After your page has been published (uploaded), you will need to test it. Start your web browser and surf to the page on your website. Important: in order to see your advertisement, you need to be checking your "live" page on your website, and not the local copy on your own computer.
  7. If the ad does not appear at first, wait a while and then reload the page and the advertisements should appear. The slowness of the advertisement to show up on your website is generally a one-time thing. The first time Google encounters a new page, it sends its "bot" (computer program) to retrieve a copy of that page. From that copy, it tries to determine what your web page is about, so that it can deliver advertisements that may be relevant to people seeing such content.

Ad placement on page

If you have checked the heat map you will see that the best places for the ads to be are the middle center and the left upper part of the page, we read left to right and a person will go that part of the page most of the time, try to make the ads blend in with the color and text of the page, in other words if the background of the page is white don't make the ad background red or something, it would be better a white background, there is a thing called ad blindness, what this means is that a person sees the ad and knows it's an ad and skips over it, or the colors of the ad do not agree with the persons likes and it will be ignored, If you have an ad box in the main text body area try to make the text rap around the ad and blend in with the content or text, also put an ad at the bottom or end of the main text content so people will have somewhere to go when they are done if they like.


make money with wdsense best ways. 

As I said above, there are some people who make hundreds of thousands of dollars per month from AdSense and there are some who make just a few dollars.
The difference between these two people is about more than just traffic – although that’s part of it. There are websites that receive thousands of visitors every day and may only receive $5 in AdSense revenue by the end of the day. Another website might be able to convert that same traffic into more than $100 of daily AdSense revenue.
You will make more money from AdSense if your website features keywords from a competitive niche.
Advertisers will pay a lot more money for a search keyword like “best lawyer in Los Angeles” than they would for “best free solitaire game online.” While the first keyword might be worth $3 per click, the other keyword may only be worth pennies.
One click on a high-value advertisement may be worth hundreds of clicks on a low-value advertisement.
With that in mind, there are two broad ways to make a lot of money on Google AdSense:

  • Get a few clicks on high-value advertisements
  • Get a lot of clicks on low-value advertisements

When you read other AdSense guides around the internet, they often toss around 5 figure numbers like they’re nothing. They make it sound like every half-decent AdSense publisher is making $10,000 per month while sitting at their computer playing video games all day.
Sorry to burst your bubble, but most publishers will never make $10,000 per month.
Don’t let that discourage you! But you need to be realistic. If there was an easy way for anybody to sit at their computer making 5 figures, then everybody would be doing it.
Making a lot of money with AdSense takes creativity, intelligence, and, most importantly, a dedication to hard work.
If you have all three of those things, then there’s no reason why you can’t make a lot of money with Google AdSense.

how to build website for adsense.

So you want to build a website and make money with Google AdSense.
One of the best tips any new AdSense user can get when building a new website is to build websites based on topics they’re interested in. Building a website about a topic you know and like is significantly easier than building a website on a foreign and confusing subject.
Why?
  • You don’t have to spend as much time researching
  • You get to enjoy your work
  • You can carve out a niche and become a well-respected authority website
There are dozens of other good reasons, but those are the most important ones. The more you know about a topic, the more content you can write. The more content and traffic your website has, the more AdSense revenue you can earn.
Building a website isn’t nearly as hard as many people think. Ten years ago, you may have required in-depth knowledge of FTP, HTML, Java, and other web development topics. Today, even someone who can barely send an email should be able to create a website in under an hour.
Here are the basic steps to building a website with AdSense:
      Step 1) Buy a domain
      Step 2) Sign up for a web host
      Step 3) Build your site’s content, pages, etc.
      Step 4) Sign up for AdSense and post advertisements on your site using a plugin or coding
There are a number of ways to simplify each step. Many web hosting companies give new users a free domain upon signup, for example, which means you can skip step 1 and go straight for step 2.
Furthermore, Content Management Systems (CMS) like WordPress have made the content-producing side of things ridiculously simple. WordPress is the most popular CMS out there today, which is why most web hosts offer one-click installation of WordPress on all hosting accounts.
Unless you know web development coding languages, then you should use WordPress or the CMS of your choice to build your website.
WordPress is a What You See Is What You Get (WYSIWYG) platform. When you create a new page or new blog post, editing the content is extremely easy because everything you see on screen is what is going to be displayed on the page. If you’ve used programs like Microsoft Word before, then you won’t have any problem building an awesome website using WordPress.
Being a successful AdSense publisher doesn’t mean you need to know any coding languages or have in-depth knowledge about web development. Thanks to new online tools, building a website has never been easier than it is today.
Many of the world’s most successful AdSense publishers have never written a line of code in their lives.

Thursday, July 23, 2015

seo tips for blogger

SEO TIPS FOR BLOGGER.


As always guys and gals, if you have any other tips please leave me a comment and add to the fun. I absolutely love reading the huge comment-essays that you all tend to write.
1. You need your own domain and hosting
The first thing that beginners need to know is that you need your own domain and hosting. Free blog set ups do not do any favors for your SEO efforts.
Why is that?
Well many people speculate that if you were really serious about your website you would get your own name and host it yourself. And Google only wants to point to websites that are considered serious and trustworthy.
I recommend all new bloggers get their own domain and hosting setup right from the beginning. You can read more about why in my review blog hosting that I did recently or check out my 9,000-word guide on how start a blog and dominate your niche. It has lots of details and tips.
2. Solve problems with original content
You have to remember that Google’s whole purpose is to provide their customers with relevant and useful search results. Everything they do is built around the premise.
And, to be realistic, the most important thing you can do for your SEO is create massively useful content that solves people’s problems. If you are solving problems that people are searching for then it is likely that you are going to get shared on social media and ranked in Google.
The phrase “original content” means so much more than just blog posts nowadays. You should start expanding into:
  • Photography
    Get on Flickr or Photobucket and use original images on your blog. Even better if you take them yourself.
  • Videos
    Make tutorials or do video posts with your webcam. This builds links and traffic from Youtube and does well on mobile devices.
  • Podcasts
    iTunes is growing fast as people get better smart phones and spend more time plugged in. You can check out podcast right here.
  • Tools and plugins
    If you can develop an original tool and install it on your website you can be assured of top Google rankings for a long time. Google absolutely loves helpful plugins and tools  that people can use in their lives.
The idea is to build a relationship with your readers by helping them out. This will mean more sharing and faster results on the SERPS (search engine rankings positions).
3. Build relevant backlinks in a natural way
If you are just getting started with SEO you might know a little about backlinks. A backlink is when another website links back to your site from their site.
Not all backlinks are created equal though. Some things to know:
  • Never buy them
    I once heard about a guy who was the head SEO guy for an investment company. He bought some cheap backlinks on a domain name with millions of dollars and got the thing banned from Google. Never buy backlinks. Google is on to them.
  • The source matters
    The blog that is giving you the backlinks makes a huge difference. If it is an old domain name with excellent rankings itself then the backlink counts for more. One good link from an authority domain name (.edu and .gov ones are amazing) and your rankings change more than hundreds of little ones.
  • The anchor text matters
    The anchor texts is the words that are used as the link. For example, just then I used “anchor text” as the anchor text. You want this to be relevant to your targeted keywords.
As mentioned, the best way to build quality backlinks is to write amazing quality content and then guest post on the best blogs in your niche. Here’s blogging strategy  that has worked well for me.
Remember, backlinks to your OWN content is also really important. See how many links I have to my own articles in this blog post? Those count too!
NOTE: Using plain keywords as anchor text is no longer the recommended method. There needs to be a natural mix of keywords in your links..
4. Make sure your theme is SEO optimized
This is the topic of a whole series of posts so I’ll keep it brief.
Think of SEO as having two components: the off-site stuff like social media and backlinks and the on-site stuff like optimizing your theme.
Optimizing your theme is important because it helps give Google indicators that you are a trustworthy site. It also helps Google find your content. Some of the things you can do include:
  • Cleanly coded
    Make sure your theme is coded with the latest and greatest techniques so that it is easy to get around.
  • Fast loading
    A fast loading site is good for user experience and thus good for Google. Make sure your theme is pulling its weight and loading quickly. . You can use cache plugins to help speed things up.
  • Original
    Some people disagree but I still reckon that my original themes do better than themes that thousands of other people are using. A newly developed and original site also comes with dozens of other benefits.
  • No broken bits
    Make sure you clean up any broken links and make sure your navigation all works smoothly.
The best paid themes for SEO at the moment are those made over at studiopress. 
Having a well designed theme is also important for your brand. Separating yourself from the competition is a very important thing to do.
5. Fix your permalink structure
Permalinks are how people locate your blog and its internal posts and pages. They are made up of a root and an extension.
For example, on this post we have:
ROOT: blogtyrant.com/
EXTENSION: beginnger-blogging-seo/
Now, it is very important to have a good permalink structure. You can change this in WordPress by going SETTINGS > PERMALINKS and tweaking the options. The best option to have in there, in my opinion, is just the post name. So you should select CUSTOM STRUCTURE and then add /%postname%/
However, even better than that is to research what keywords you are trying to rank for and then shorten your URL to match those keywords. Take a look at this post and have a guess what key words I was trying to rank for.
Be warned! You don’t want to change the old permalinks because then any backlinks you have will be broken. Just new ones.
6. Install a sitemap
One of the easiest things you can do is install a Google Sitemap plugin that gives a full map of all your posts, pages and archives. The most common one that people use is this one and it seems to work quite well.
This automatically generates the sitemap for you at regular intervals and then submits it to Google, Bing, etc. on your behalf. Its literally giving them a map of your site so they can index it better.
7. Comment on other blogs
For a long time my SEO strategy consisted of just comments on author blog. Not only does it get you more traffic, exposure and new relationships, it also counts as a backlink.
Now, some blogs you can leave target anchor text because they aren’t real worried about user names. But on most blogs you need to use your real name. That’s fine.
Try and use market samurae to see where your competitors are getting their backlinks from. You might just find a bunch of them come from comments on well ranked blog posts.
8. Build your social media profiles big time
As I mentioned in my post on seo secrets you want to now have a big focus on social media for SEO purposes as well as traffic building purposes.
Why?
Well because Google is now looking to social media as a signal of an article’s authority and relevance.
If thousands of people are tweeting about it then chances are you have written something pretty good. And the best way to get tweets is to build a loyal following and write killer content that they just love to promote for you.
Some things you need to start doing:
  • Tweeting big players
    Get to know the big players in your niche by casually building a rapport with them on Twitter. Down the track you can hit them up for re-tweets.
  • Add separate value
    Tweet and Facebook information and facts that don’t appear on your blog. Think of it as a separate resource for people to tap in to.
  • Share others
    The more content you share from other bloggers the more likely they are to share your stuff. Give and then get later.
Neil Patel (one of my blogging heros) has just written a really cool list about how to use twitter. That is a good place to start if you want to really amp up your social activities.
NOTE: Google+ is now a huge factor in SEO rankings. Here is a post I did with some important google tips to get your started.
9. Use SEO plugins
There are lots of WordPress plugins out there that you can install to get some help with your SEO. One of the best ones to start with is the all in one seo tips  which does so many of the nasty little things for you.
There are a lot of other good SEO plugins out there so I thought I would open this one up to the audience and see what everyone else is using. Please leave a comment and let me know.
10. Read, study and use SEOmoz
As far as I am concerned the absolute best resource for SEO related material in the world is over at seo moz
tools are amazing.
Now, the content on their blog might be a little over your head to begin with but you will slowly start to absorb ideas about trends, tactics and best practices over time. Even if you only check in every couple of weeks and read one or two articles you will find that your SEO knowledge just grows and blossoms.

Wednesday, July 22, 2015

5 Untold SEO Tips (increase traffic on blog)

5 Untold SEO Tips (increase traffic on blog) 

seo means search engine optimization.here is some tricks
 and tips for increase page rank.From a marketing prospective, SEO is still alive and will be forever, because search engines mostly rely on the content published by authors/bloggers & companies. However, there are new algorithm updates every another day released by major search engines such as Google, which makes the small business owners & bloggers unhappy, because they have to slightly change their seo strategies. as per the  

5 Untold SEO Tips new changes. And thus, many bloggers/webmasters try to search for updated tips/techniques on the internet, so in this regard, I came up with 5 untold SEO tips which can help you targeting your goals in SEO. Remember, I’ve always been a white-hat SEO guy who’s never used any black-hat or unethical ways to improve search engine rankings after Google Algorithms Panda (in 2011) and Penguin (in 2012). In fact, you should never be afraid of any algorithm if you are doing your best in a natural way to make humans happy & satisfied instead of only targeting the search engine bots which never understand the feeling of a real human. To make it easier for you, I’ve recently experimented some best SEO practices (on-page & off-page), which I’m sharing with you throughout this post.
seo tips

Top 5 SEO Tips in 2015

So this is the list of top 5 tips I’m sharing with you on this page, these all are for getting organic real results from Google & other search engines, first of all I recently tried to implement these tips myself, and when I got better results then I decided to share them on my blog. And as you know, the new year 2015 is just knocking the doors, so I think these tips will work best in 2015 and afterwards. Now let’s move on to the tips.

Tip # 1 – Update Your Content Regularly

This is the number one tip I can give you, because it has worked for me many times and search engines also highly recommend you to update your content in accordance with the current date. What I mean by updating content?, I simply mean, whenever you publish something on your blog in shape of a post/article, few days after publishing, go to that post/article, edit it and add some more text/image or video etc, and then update it, you’ll see search engines bots coming back to your post and crawling the updated version of your post. It works great, you’ll see dramatic boosts in the ranking of that particular article/post. I always try to update my normal posts in a period of 2 months and popular in 3 months. But I’ll recommend you to update the new posts on weekly basis if you want to get quick ranking from search engines, and this is all SEO friendly & original thing to do.
Bonus Tip: to keep an eye on the progress after updating the posts/articles, use a keyword tracking tool such as moonsy.com or serpbook.com.
And to let the search engines properly know that you have updated your post/posts use the modified-date or updated date [meta], if you are using WordPress then you can use this plugin for last updated date: wp last modified date.

Tip # 2 – Include a Video in Your Post

This is another great strategy worked for me and can work for you too, I recently experimented it on a live blog post, first of all I created a video on something, then I created a blog post with a permalink & I kept that in the draft mode, However, I uploaded the video to YouTube.com, Vimeo.com, Dailymotion.com & tune.pk. These are popular video sharing sites with millions of visitors every single day. I added the blog post link to the description of the video on all four places where I uploaded the video and I also mentioned in the video about visiting the blog post if the person wants to get full information. After uploading the video, I published the blog post, and this worked very well in getting better ranking, in simple words you can say, I got four links from a single video on four different platforms & I got many visitors to that post. And having a video in blog post really attracts search engine bots to give extra exposure to that post, because video speaks much loudly than words.
Tip: Again keep tracking your keyword for that post, so you may know whether it’s getting improved or not.

Tip # 3 – Create E-Books & Presentations

SEO today has to be played on a real ground, and when that’s being said, you have to be more social, more natural & more helpful. If you want to really improve your blog/site ranking in a real organic way then take out some time and create some free E-Books & presentations on the topics you cover on your blog, after creating a simple 10-20 pages e-book, go and upload it to all platforms which offer free e-books such as this one:
  • www.free-ebooks.net
Don’t forget to include your blog/site URL in the e-book as well as in your profile you create over these sites, you’ll get tons of backlinks quickly. You can find top 5 free e-books service by doing this simple Google search “Free e-books submit”.
Now after e-books, one more easiest step is to create PowerPoint presentations on something you know, it might be short or long that doesn’t matter, but always include your site in the presentation & also in your biography on the website where you upload your presentations, these sites will work best for you to upload your free presentations and get backlinks:
  • www.slideshare.net
  • www.slideboom.com
  • www.powershow.com
  • www.sliderocket.com
  • www.slideroll.com
  • www.slideworld.com

Tip # 4 – Use Fetch As Google [in Urgency]

If you want to let the Google crawler know about your website faster & to index/rank it quickly then you can do it yourself straight from the google web master tools account, there is an option in Webmaster Tools called “Fetch As Google”, which does a very smooth job, I mean you can put the URL either of your home page or any single post in that tool which will be immediately crawled & indexed by Google.
Go to your webmaster account >> Click the website you want to see >> at left side find >> Crawl >> Fetch As Google >> it will already have the main URL of your blog/site, so if you want it to crawl the main site then simply leave the box blank and click “Fetch“, after you click fetch, within seconds, Google will tell you whether your site has been accessed or not. And you can also submit it for indexation.
This process is particularly helpful for new websites or new articles/posts, because certainly Google crawlers take sometime to index your site or post, so you can instantly do it yourself. And yes, it worked for me always.

Tip # 5 – Build Quick, But Natural Backlinks

If you are taking very much care of your On-Page SEO stuff such as optimized titles, permalinks, meta description,keyword density interlinking and social media sharing etc, that all is OK and great to know, But if you are not building quality & natural backlinks overtime then don’t think for a long term stable ranking in Google. So keeping this in mind, you have to use all available resources to create backlinks for your site & single articles. In short, if you want to regularly & quickly build some backlinks through blog commenting, Dofollow sites & .edu/.gov then use below website to create tons of free backlinks over time and improve your overall search engines ranking:
  • Dropmylink.com
This is a website where you can put your keyword and select a category from the list of available resources, so it will show the results of blogs/sites where you can comment or post something to get a backlink or simply a link.
Another site which you can use to find the relevant forums according to your niche and build backlinks is this one:
  • boardreader.com
By using this website, you can find the relevant forums exactly related to your main keyword, just write your keyword and get the instant list of forums where you can participate in the discussion & create backlinks.
Bonus Tip:
OK, so there are hundreds of strategies SEO guys make and most of them change the strategies overtime if they are not working for them. For any optimizer, the strong keyword research is one of the initial keys to success in SEO. Therefore, always do a in depth keyword research before starting optimizing a keyword, because when you know what can be the future potential in a keyword or topic then you’ll use the best part of your brain to bring that keyword into the 1st page of Google.
Conclusion: 
These are some simple, but white-hat & I guess untold SEO tactics which you can use to improve your overall ranking in Google and also in other search engines, I’ve experimented them recently and all of them worked for me. However, there are hundreds of other SEO tips out there which can also be useful for improving ranking, so testing something new is not prohibited. Wish You Best of Luck!


Tuesday, July 21, 2015

New JavaScript & jQuery Tutorials

New JavaScript & jQuery Tutorials.

JavaScript is one of the greatest and powerful client side scripting language which is used massively these days in web applications. Whether you want to create html site or to create dynamic site using php  all you’ll need to use JavaScript in some or many parts of your projects. JavaScript does many jobs which other languages including PHP & ASP even can’t do. This language changes your static site to a dynamic site within milliseconds using few line of codes. We’ll be sharing a series of video tutorials with you to learn JS & jQuery from scratch. However, you can wait for our upcoming advance tutorials on this subject, where we’ll be able to push you towards some projects.

What does really JavaScript & jQuery do?

javascript can validate HTML forms before they are submitted to a web server(it saves extra server requests), JavaScript can be used to react on a page when a visitor clicks an HTML element, when a visitor enters to a page, when a visitor leaves a page and so on. JavaScript can also be used to save visitors’ information in your server, it can detect the visitor’s information such as the IP address, the browser, the location etc. In JS we can create pop up boxes and pop up windows. There are many things more we can do using JS.
While jQuery is very beautiful library of JS, which is used to do the big tasks with less codes, you can create image sliders using jQuery, you can create image galleries in jquery, you can make video galleries in jQuery and there are many things you can do using jQuery.

other similar language to javascript'

  • json (a web language for structuring text data)
  • ajax(asynchronus javascript and html)
  • dom (document object model)
  • bom (browser object model)
  • dhtml (dynamic hyper text markup language)

JavaScript - Page Printing

Many times you would like to place a button on your webpage to print the content of that web page via an actual printer. JavaScript helps you to implement this functionality using the print function of window object.
The JavaScript print function window.print() prints the current web page when executed. You can call this function directly using the onclick event as shown in the following example.

Example

Try the following example.
<html>
   <head>
      
      <script type="text/javascript">
         <!--
         //-->
      </script>
   
   </head>
   
   <body>
      
      <form>
         <input type="button" value="Print" onclick="window.print()" />
      </form>
   
   </body>
<html>

Output

Although it serves the purpose of getting a printout, it is not a recommended way. A printer friendly page is really just a page with text, no images, graphics, or advertising.
You can make a page printer friendly in the following ways −
  • Make a copy of the page and leave out unwanted text and graphics, then link to that printer friendly page from the original. Check Example.
  • If you do not want to keep an extra copy of a page, then you can mark your printable text using proper comments like <!-- PRINT STARTS HERE -->..... <!-- PRINT ENDS HERE --> and then you can use PERL or any other script in the background to purge printable text and display for final printing. We at Tutorialspoint use this method to provide print facility to our site visitors. CheckExample.

How to Print a Page

If you don’t find the above facilities on a web page, then you can use the browser's standard toolbar to get print the web page. then click this code
file-print-click ok button

JavaScript - Document Object Model or DOM

Every web page resides inside a browser window which can be considered as an object.
A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects which allow access to and modification of document content.
The way a document content is accessed and modified is called the Document Object Model, or DOM. The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.
  • Window object − Top of the hierarchy. It is the outmost element of the object hierarchy.
  • Document object − Each HTML document that gets loaded into a window becomes a document object. The document contains the contents of the page.
  • Form object − Everything enclosed in the <form>...</form> tags sets the form object.
  • Form control elements − The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes.
Here is a simple hierarchy of a few important objects −
HTML DOM
There are several DOMs in existence. The following sections explain each of these DOMs in detail and describe how you can use them to access and modify document content.
  • The Legacy DOM − This is the model which was introduced in early versions of JavaScript language. It is well supported by all browsers, but allows access only to certain key portions of documents, such as forms, form elements, and images.
  • The W3C DOM − This document object model allows access and modification of all document content and is standardized by the World Wide Web Consortium (W3C). This model is supported by almost all the modern browsers.
  • The IE4 DOM − This document object model was introduced in Version 4 of Microsoft's Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features.

DOM compatibility

If you want to write a script with the flexibility to use either W3C DOM or IE 4 DOM depending on their availability, then you can use a capability-testing approach that first checks for the existence of a method or property to determine whether the browser has the capability you desire. For example −
if (document.getElementById) {
   // If the W3C method exists, use it
}

else if (document.all) {
   // If the all[] array exists, use it
}

else {
   // Otherwise use the legacy DOM
}

jQuery - DOM Manipulation

JQuery provides methods to manipulate DOM in efficient way. You do not need to write big code to modify the value of any element's attribute or to extract HTML code from a paragraph or division.
JQuery provides methods such as .attr(), .html(), and .val() which act as getters, retrieving information from DOM elements for later use.

Content Manipulation

The html( ) method gets the html contents (innerHTML) of the first matched element.
Here is the syntax for the method −
selector.html( )

Example

Following is an example which makes use of .html() and .text(val) methods. Here .html() retrieves HTML content from the object and then .text( val ) method sets value of the object using passed parameter −
<html>
   <head>
      <title>The jQuery Example</title>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  
      <script type="text/javascript" language="javascript">
         $(document).ready(function() {
            $("div").click(function () {
               var content = $(this).html();
               $("#result").text( content );
            });
         });
      </script>
  
      <style>
         #division{ margin:10px;padding:12px; border:2px solid #666; width:60px;}
      </style>
  
   </head>
 
   <body>
 
      <p>Click on the square below:</p>
      <span id="result"> </span>
  
      <div id="division" style="background-color:blue;">
         This is Blue Square!!
      </div>
  
   </body>
 
</html>
DOM Element Replacement
You can replace a complete DOM element with the specified HTML or DOM elements. The replaceWith( content ) method serves this purpose very well.
Here is the syntax for the method −
selector.replaceWith( content )
Here content is what you want to have instead of original element. This could be HTML or simple text.

Example

Following is an example which would replace division element with "<h1>JQuery is Great</h1>" −
<html>
   <head>
      <title>The jQuery Example</title>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  
      <script type="text/javascript" language="javascript">
         $(document).ready(function() {
            $("div").click(function () {
               $(this).replaceWith("<h1>JQuery is Great</h1>");
            });
         });
      </script>
  
      <style>
         #division{ margin:10px;padding:12px; border:2px solid #666; width:60px;}
      </style>
  
   </head>
 
   <body>
 
      <p>Click on the square below:</p>
      <span id="result"> </span>
  
      <div id="division" style="background-color:blue;">
         This is Blue Square!!
      </div>
  
   </body>
</html>
Removing DOM Elements
There may be a situation when you would like to remove one or more DOM elements from the document. JQuery provides two methods to handle the situation.
The empty( ) method remove all child nodes from the set of matched elements where as the method remove( expr ) method removes all matched elements from the DOM.
Here is the syntax for the method −
selector.remove( [ expr ])

or 

selector.empty( )
You can pass optional paramter expr to filter the set of elements to be removed.

Example

Following is an example where elements are being removed as soon as they are clicked −
<html>
   <head>
      <title>The jQuery Example</title>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  
      <script type="text/javascript" language="javascript">
         $(document).ready(function() {
            $("div").click(function () {
               $(this).remove( );
            });
         });
      </script>
  
      <style>
         .div{ margin:10px;padding:12px; border:2px solid #666; width:60px;}
      </style>
  
   </head>
 
   <body>
 
      <p>Click on any square below:</p>
      <span id="result"> </span>
  
      <div class="div" style="background-color:blue;"></div>
      <div class="div" style="background-color:green;"></div>
      <div class="div" style="background-color:red;"></div>
  
   </body>
 
</html>
This will produce following result:

Inserting DOM elements

There may be a situation when you would like to insert new one or more DOM elements in your existing document. JQuery provides various methods to insert elements at various locations.
The after( content ) method insert content after each of the matched elements where as the method before( content ) method inserts content before each of the matched elements.
Here is the syntax for the method −
selector.after( content )

or

selector.before( content )
Here content is what you want to insert. This could be HTML or simple text.

Example

Following is an example where <div> elements are being inserted just before the clicked element −
<html>
   <head>
      <title>The jQuery Example</title>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  
      <script type="text/javascript" language="javascript">
         $(document).ready(function() {
            $("div").click(function () {
               $(this).before('<div class="div"></div>' );
            });
         });
      </script>
  
      <style>
         .div{ margin:10px;padding:12px; border:2px solid #666; width:60px;}
      </style>
  
   </head>
 
   <body>
 
      <p>Click on any square below:</p>
      <span id="result"> </span>
  
      <div class="div" style="background-color:blue;"></div>
      <div class="div" style="background-color:green;"></div>
      <div class="div" style="background-color:red;"></div>
  
   </body>
 
</html>
This will produce following result:

DOM Manipulation Methods

Following table lists down all the methods which you can use to manipulate DOM elements −
S.No.Method & Description
1after( content )
Insert content after each of the matched elements.
2append( content )
Append content to the inside of every matched element.
3appendTo( selector )
Append all of the matched elements to another, specified, set of elements.
4before( content )
Insert content before each of the matched elements.
5clone( bool )
Clone matched DOM Elements, and all their event handlers, and select the clones.
6clone( )
Clone matched DOM Elements and select the clones.
7empty( )
Remove all child nodes from the set of matched elements.
8html( val )
Set the html contents of every matched element.
9html( )
Get the html contents (innerHTML) of the first matched element.
10insertAfter( selector )
Insert all of the matched elements after another, specified, set of elements.
11insertBefore( selector )
Insert all of the matched elements before another, specified, set of elements.
12prepend( content )
Prepend content to the inside of every matched element.
13prependTo( selector )
Prepend all of the matched elements to another, specified, set of elements.
14remove( expr )
Removes all matched elements from the DOM.
15replaceAll( selector )
Replaces the elements matched by the specified selector with the matched elements.
16replaceWith( content )
Replaces all matched elements with the specified HTML or DOM elements.
17text( val )
Set the text contents of all matched elements.
18text( )
Get the combined text contents of all matched elements.
19wrap( elem )
Wrap each matched element with the specified element.
20wrap( html )
Wrap each matched element with the specified HTML content.
21wrapAll( elem )
Wrap all the elements in the matched set into a single wrapper element.
22wrapAll( html )
Wrap all the elements in the matched set into a single wrapper element.
23wrapInner( elem )
Wrap the inner child contents of each matched element (including text nodes) with a DOM element.
24wrapInner( html )
Wrap the inner child contents of each matched element (including text nodes) with an HTML structure.