0% found this document useful (0 votes)
4 views76 pages

Notes 1063 UNIT-4

AJAX (Asynchronous JavaScript And XML) is a technique used to update web pages asynchronously by exchanging data with a web server without reloading the entire page. It involves creating an XMLHttpRequest object to send requests and handle responses, allowing for dynamic content updates based on user interactions. Additionally, the document discusses SEO strategies, including the importance of keywords, linking, and proper use of title and meta tags to improve search engine rankings.

Uploaded by

oknotokay098
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views76 pages

Notes 1063 UNIT-4

AJAX (Asynchronous JavaScript And XML) is a technique used to update web pages asynchronously by exchanging data with a web server without reloading the entire page. It involves creating an XMLHttpRequest object to send requests and handle responses, allowing for dynamic content updates based on user interactions. Additionally, the document discusses SEO strategies, including the importance of keywords, linking, and proper use of title and meta tags to improve search engine rankings.

Uploaded by

oknotokay098
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

AJAX

AJAX-Asynchronous JavaScript And XML


• Used to

• Read data from a web server - after the page has loaded
• Update a web page without reloading the page
• Send data to a web server - in the background
• AJAX is not a programming language.

• It is just a combination of:

• A browser built-in XMLHttpRequest object (to request data from a


web server)
• JavaScript and HTML DOM (to display or use the data)
• AJAX allows web pages to be updated asynchronously by exchanging
data with a web server behind the scenes. This means that it is
possible to update parts of a web page, without reloading the whole
page.
How Ajax works-
• 1. An event occurs in a web page (the page is loaded, a button is
clicked)
• 2. An XMLHttpRequest object is created by JavaScript
• 3. The XMLHttpRequest object sends a request to a web server
• 4. The server processes the request
• 5. The server sends a response back to the web page
• 6. The response is read by JavaScript
• 7. Proper action (like page update) is performed by JavaScript
The main steps of AJAX is the
XMLHttpRequest object.
• Create an XMLHttpRequest object
• Define a callback function
• Open the XMLHttpRequest object
• Send a Request to a server
The XMLHttpRequest Object
• All modern browsers support the XMLHttpRequest object.

The XMLHttpRequest object can be used to exchange data


with a web server behind the scenes. This means that it is possible to
update parts of a web page, without reloading the whole page.
Syntax of creating XMLHttpRequest object:
variable = new XMLHttpRequest();
Define a Callback Function
• A callback function is a function passed as a parameter to another
function.

The callback function should contain the code to execute


when the response is ready.

xhttp.onload = function() {
// What to do when the response is ready
}
Open and send a request
To send a request to a server, you can use the open() and send()
methods of the XMLHttpRequest object:

xhttp.open("GET", "ajax_info.txt");
xhttp.send();

Syntax: open(method, url, async, user, psw)


method: the request type GET or POST
url: the file location
async: true (asynchronous) or false (synchronous)
user: optional user name
psw: optional password
Send a Request To a Server
• xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();

• The url - A File On a Server


• The url parameter of the open() method, is an address to a file on a
server:

• xhttp.open("GET", "ajax_test.asp", true);


Asynchronous - True or False?
• Server requests should be sent asynchronously.
• The async parameter of the open() method should be set to true:

xhttp.open("GET", "ajax_test.asp", true);

• By sending asynchronously, the JavaScript does not have to wait for


the server response, but can instead:
• execute other scripts while waiting for server response
• deal with the response after the response is ready
Server Response Properties
Property Description

responseText get the response data as a


string
responseXML get the response data as XML
data
The responseText Property
• The responseText property returns the server response as a JavaScript
string, and you can use it accordingly:

document.getElementById("demo").innerHTML = xhttp.responseText;
The responseXML Property
• The XMLHttpRequest object has an in-built XML parser.

• The responseXML property returns the server response as an XML


DOM object.
• <!DOCTYPE html>
• <html>
• <body>

<div id="demo">
• <h2>The XMLHttpRequest Object</h2>
• <button type="button" onclick="loadDoc()">Change Content</button>
• </div>

<div>
• <h6> i am heading h6</h6>
• </div>

<script>
• function loadDoc() {
• let xhttp = new XMLHttpRequest();
• xhttp.onload = function() {

• //document.getElementById("demo").innerHTML = this.responseText;
• console.log(this.responseText);
• }
• xhttp.open("GET", "https://jsonplaceholder.typicode.com/posts",true);
• xhttp.send();
• }
• </script>

</body>
• </html>

SEO

Search Engine Optimization


Offline / Online

Offline, bustling crowds pass by your Online, people search for information.
place of business. Some of the passerby Millions of people. Each searches alone.
traffic notices you and walks in.

"Location, Location, Location" "Information, information, information"


SOME FACTS TO CONSIDER
• According to qSearch,
approximately 85% of the
Canadian Internet population
conducts at least one search
at the top engines each
month (compared to 73% of
the U.S. on-line population).
Canadians conducted
approximately 575 mln
searches last April, while 1.2
bln US searches made in May
2004.
• Google - Searching 4,285,199,774 web pages

• 28% of Google searches are for a "product/service name", 9% are


for a "brand name" and 5% are searches for a "company name".

• 85%* of all Web site traffic and 70%* of all online purchases
originate from a search engine. (*Jupiter Research)

• Micro Commerce opportunities for new products and services


will generate an estimated $60 bln in revenue per year by 2015
according to Gartner. A micro purchase is a purchase valued at
less than $5 and conducted electronically, where the settlement
can be either prepaid, by subscription, on-the-spot, or invoiced.

• For More Facts Visit http://www.itfacts.biz


Site Building Process
Issues to Cover

Definitions
SEO and SEM Strategies
Definitions
• SE - Search Engine is a tool that enables users to locate information
on the World Wide Web. Search engines use keywords entered by
users to find Web sites which contain the information sought.

• Web Directory - a search service that arranges the web pages it


knows about into categories and subcategories. Often picked by
human beings for inclusion in the categories.

• SEO / SEM - A form of online marketing, Search Engine Optimization


/ Search Engine Marketing is the process of making a site and its
content highly relevant for both search engines and searchers.
Successful search marketing helps a site gain top positioning for
relevant words and phrases.

Definitions
PR = Page Rank a system for ranking web pages
developed by Google - http://toolbar.google.com
• PPC = Pay Per Click online advertising payment model in
which payment is based solely on qualifying click-
through.
• CTR = Click Through Rate advertising term indicating
the percentage of viewers who click on a banner
advertisement and follow the link
• BLOGS = a frequent, chronological publication of
personal thoughts and Web links
• RSS = Real Simple Syndication
Key internet marketing strategies

• Search engine optimization (SEO)


- no cost per click
• Search engine marketing (SEM)
- cost per click
Search
What is SEO?
engine optimization
SEO is the act of modifying a website to increase its ranking in
organic (vs paid), crawler-based listings of search engines

How do organic search listings work?


• A spider or crawler which is a component of a SE gathers listings
by automatically "crawling" the web
• The spider follows links to web pages, makes copies of the
pages and stores them in the SE’s index
• Based on this data, the SE then indexes the pages and ranks the
websites
• Major SEs that index pages using spiders: Google, Yahoo,
AltaVista, MSN, AOL, Lycos
TOP Search Engines and Directories
• The TOP 8:
1. Google
2. Yahoo
3. MSN
4. AOL
5. Altavista
6. Infoseek
7. Lycos
8. Excite
represent 88.86% of all search engines.
• Web Directory – Yahoo, DMOZ, LookSmart
SEO strategies/techniques

1. Domain name strategies

- domain names are traffic magnets


> 63 million domain names registered
> 4.7 million domain names registered 1st quarter 2004
- choose a domain name that will increase your search
engine ranking.
How?
- use keywords, location, advertising terms, product names
- choose a keyword that is important for your business
2. Linking strategies

- the text in the links should include keywords


- the more inbound links the higher the SE ranking
- if the site linking to you is already indexed, spiders will also
receive your site
- quality of inbound links is critical
- how to increase links: a) creative content / copywriting b)
good outbound links c) target a list of sites from which you can
request inbound links
- links for the sake of links can damage your search rankings
“Link relevancy is critical in getting your site indexed by search
engines”

“A small number of inbound links from high-quality, relevant


sites is more valuable than many links from low-traffic,
irrelevant sites.”
3. Keywords

- the most important in optimizing rankings


- research what keywords are people searching for using
tools e.g. Wordtracker (www.wordtracker.com)

- keywords are words that appear the most in a page


- the spider chooses the appropriate keywords for each
page, then sends them back to its SE

- your web site will then be indexed based on your


keywords
- can be key phrases or a single keyword
- do not use common words eg ‘the’ ‘and’ ‘of’: spiders ignore
them

- write keyword-rich text


- balance keyword-rich and readability
- always have text in your page: at least 100 words
Keywords / Phrases Suggestion

Choose your Keywords:


- Theme Related
- Popular
4. Title tags

- important in optimizing rankings


- the first thing that a search engine displays on a search
return
- must keywords in title to be ranked no. 1
- should have the exact keyword you use for the page
- every single web page must have its own title tag
- you can use up to 65 characters - example
http://www.ebay.com/ (title is littered with keywords)

5. Meta description tags

- displayed below the title in search results


- use dynamic, promotional language
- use keywords
Meta keywords tags
- no longer carry weight with major SEs
- a myth that meta keywords alone affect rankings

6. Alt tags

- include keywords in your alt tags

7. Submit your website to SEs for indexing

- submit your site to search engine directories,


directory sites and portal sites
- indexing takes time (~ 3 months)
SEO - what is NOT recommended
Flash and shockwave - spiders do not pick up these files
Image only sites - spiders do not pick up images
Image maps - spiders cannot read image maps.
Do not use them on your home page or critical pages.
Frames - only one page can be titled (titling is critical in search
rankings)
- If the spider cannot read the complete page (because of
the frames), it will not be indexed properly.
- Some spiders may not even read a frames web site
Misspellings, JavaScript or HTML errors (validate your code)
PDF files - Although some search engines can
index them, the pages must be interpreted
into HTML and can lose much of their
content.
- place PDFs lower down in your site
Drop down menus – spiders cannot read them
therefore make sure you have a SiteMap
In summary…
Make Search Engines work for you!!!
Critical elements
- domain name, links, keywords, title, meta
description, alt tags, submitting your website to SEs
- keywords galore: include in page copy, title,
description, domain name, ALT tags
No-nos
- flash, image-only sites, image maps, frames,
password protected pages, code errors
Title tag

Meta description tag (or first para of


text if no meta des has been added)

Keywords
Search engine marketing/cont’d
Paid placements - Google

Paid placements
SEO for entire websites
Hyperlinks
Hyperlinks are connections established
between a word/phrase/image and a
website/file. The World Wide Web is based on
hyperlinks. Most often we access websites by
clicking hyperlinks.
• SEO stands for Search Engine Optimization which
defines the optimization of how a website can be
reached through search engines. This process
also involves hyperlinking.

• Actually effective hyperlinking between different


pages can help a website secure a good position
in the search engine result pages as well.
What is hyperlink?
• Hyperlink is a type of link that connect two
separate files/websites/articles/images etc.
• Hyperlink can be placed on webpages, in
spreadsheet file, in database infrastructure etc.
• Their main function is to link some data with
others so that users can get the related data at
convenience.
• Hyperlinks are sometimes used to elaborate few
topics or points
• It is used in internet as a major element of
internet connectivity.

• Webpage is attached to webpage and further


webpages; these are all possible because of
hyperlinks.

• Hyperlinks can also be explained as the path for


movement from one webpage to another or from
one file to another.
No Hyperlink No Internet
• The entire World Wide Web is linked up by
hyperlinks. Suppose there was no hyperlink on
websites, then users would have to get hold of
the URL of websites.
• Users would require to directly enter the full URL
to get to any webpage.
• Search engines mainly displays the URLs of
websites through hyperlink. If there were no
hyperlinks, how would search engines display
results. Pages of a website are also connected
with each other using hyperlinks.
Why hyperlinks important for SEO

• Internet users seek help from search engines in


order to find out desired information and related
websites.
• It is the responsibility of search engines to display
various relevant sites which can provide them
with the information they are looking for.
• If websites were not linked with search engines
through hyperlink, then search engine would
have no value of its own.
• Search engines also give priority to the sites
that have good number of inbound links
(hyperlinks) and rank them well.
• Google has introduced PR rating system only
to sort out the sites that have good inbound
links and high quality contents.
• So there is no doubt that hyperlinks play an
important role when it comes to SEO.
Management of hyperlink
Few things must be to be kept in mind and
maintained properly in order to establish a good
connection of hyperlink with SEO optimization:

• Do not place spammy/inappropriate links in your


website content.
• You should always make sure that your links are
working.
• Images must be hyperlinked with their full size
versions.
• Related contents should be hyperlinked with
each other.
• Hyperlinks which are not required must be
removed as they may slow down the speed or
accessibility of your website and result in poor
user experience.
• Do not place hyperlinks on a webpage
haphazardly. Make sure that your hyperlinks
serve a purpose and add value to your site.
Page Rank (PR) of Google
Google Page Rank

• Page Ranking (PR) is the #1 SEO factor (of


over 200 others) that Google uses to
determine the ranking of sites on its search
engine, so, you have to work on it to improve
Google ranking.
• It is a numerical figure that works on a scale
of 1 to 10
• It’s used to express the importance,
relevance, reliability, and reputation of your
site.
• In addition to the volume of links, the
PageRank algorithm also considers the origin,
the quality, and the reputation of each of the
sources that have mentioned you.
Why is Page Ranking important?

• The better the PageRank, the more likely you


are to appear at the top of search engine
results, which means more visibility and more
chances that people click on and enter your
site.

• This means you get more organic traffic. The


more people on your site, the more money you
make.
in addition to organic traffic, there are other types
of traffic:

• Pay Per Click (PPC) traffic through advertising


(costs money).
• Referred traffic: when people enter your site
through links that have been referred on other
sites.
• Direct Traffic: when the user types the URL of
your site directly into the address bar
key factor to improve Google
rankings?
• The objective of optimizing and improving
PageRank is to get as many quality external
links that point to your website organically,
i.e. not paid for, false, nor spam.

• It is important to have lots of external links or


backlinks for your SEO Page Rank
• Google thinks that if your site has been linked
to several times, it’s because you’re doing
something good.
• For them, it’s a sign that people like what you
do, your content is useful, high-quality,
relevant, and therefore you must have a
certain authority or be a quality reference in
the area that you specialize in, and that’s why
people are citing your site or content.
• Precisely because of this, it makes sense that
aspects such as reputation (real estate sites,
reputed but not popular), authority, and
relevance are so important in the concept of
PageRank and to improve Google rankings.

• Reputation is not the same of popularity. You


can have a very popular site, but with very
low PageRank.
Factors to improve on Google ranking

• Every two years, Moz, an authority in the field


of SEO, conducts a study through which, they
try to understand the Google algorithm better.
They try to determine the factors and
characteristics of the pages with the best
positions in search engine results. The key
factors are:
To clearly understand this info, we should focus on
the following FOUR insights:

• The number and quality of backlinks (external


links pointing back to your site) remain extremely
important for the Google ranking.
• Social signals continue to become stronger as a
factor to improve Google ranking
• Quality and relevant content (context) remains a
key factor, and important in building authority,
reputation, and relevance.
• The importance of the keyword in the URL or
domain has lost relevance.
The importance of your reputation
for the Pagerank.
• each site should work to consolidate and
achieve a high reputation, as this will directly
impact PageRank. That means this is
something that must be cultivated and
maintained.
• When another page in your field, who has an
excellent reputation, relevance, and
authority, puts a link pointing back to your
website, they transfer part of their reputation to
your site.
Increase Website Ranking: Domain
Authority, the other side of PageRank
• Domain Authority is the algorithm developed
by Moz, which as we mentioned before, is one
of the most authoritative sites worldwide in
the field of SEO. The Domain Authority uses
over 40 factors to determine the score, but
the main two are:
• the quantity-quality of backlinks that you get
from other sites, and
• how much authority they themselves have.
Tactics to improve Google website
Page Rank (PR) and Domain Authority
(DA)
• Clean up bad links: Although this is a task
that’s usually done by webmasters, you can
consider doing it yourself. Start by using
Google to track other pages that mention you.
If they have a low or bad reputation, then you
can ask them to remove your link from their
sites.
• Get good backlinks:
How to get good backlinks?
• Produce high quality, relevant content, so that
people find your site and content linkable.
• Share your content on social networks, as they are
another avenue for redistribution of your links, and
also through this tactic you can earn likes, retweets,
and +1s, which function as social signals that add
points to your reputation and in turn, up your
PageRank.
• Participate actively in forums and communities to
share information of quality and relevance. This is a
great way to distribute your links and to get your
content or site to reach others.
• Create, develop and enhance your relationships with
influencers, bloggers, consultants, and editors. In every
industry, you should already know that there are a number of
reputable figures that people listen to and trust. Take
advantage to develop relationships with them,
because they’ll be able to enhance distribution of your
content, and include quality backlinks to your blog.

• Submit a profile on Wikipedia and other directories, so that


people can find you through different channels which also
possess high reputation.

• Guest Blogging: although this practice has been discredited


due to the generation of poor quality articles, which have
become spam (since they were used only to promote links),
Google has failed to encourage this tactic. But, if you can
ensure that you can create a high-quality guest post, that’s
relevant to the context of your area, then go ahead.
• Promote images and videos through
infographics, photos, presentations, webinars,
came videos. YouTube adds a lot of weight
and reputation.
• Make quality contributions
through comments on other articles or
sites where you can mention your link.
verify your website’s ranking on
Google
free tools exist to check the ranking of your
website on Google.
• Rankerizer
• Free Monitor for Google
• Pro Rank Tracker
• Serplab
Click Through Rate
organic click-through-rate is a calculated
metrics that tells you how many people
clicked through out of the total number of
people who saw it. In organic SEO, this means
how many people saw your search result, and
how many people clicked through to the page.
• If hundreds of thousands of people see your
search result, but no one clicks on it, it’s
wasted effort. It’s very similar to traffic
generation and conversion rates – i.e. if you
generate hundreds of thousands of visitors
and no one converts, it’s wasted effort.
• Similarly, investing in CTR optimization can
bring a ton of ROI to your overall SEO efforts
How is CTR Related to SEO?

• if you’re the first SERP result and few people click


through, you’re not optimized.
• Traffic is what counts (well, conversions count) not
impressions, so in the most basic sense, click-through-
rate optimization is a part of search engine
optimization.

• But is click-through-rate actually used as a ranking


factor? In other words, if something ranking low on the
results page gets a stunningly high click-through-rate,
would Google bump it up?
• This is a bit of a chicken versus egg problem
How Can We Improve Organic Click-
Through-Rate?
• Optimize Your Title
• Optimize Your Meta Description
• Optimize Your URLs
– The more readable by human beings, the better
– Keywords in URLs: still a good thing
– Exclude dynamic parameters when possible
– Shorter > longer
– Match URLs to titles most of the time (when it makes sense)
– Including stop words isn’t necessary (like and, but, or, etc.)
– Keyword stuffing and repetition are pointless and make
your site look spammy
Resident time on website
1. Unintentional duplicate content
Most of us know that duplicate content online is a big no-no. But did you know that most
duplicate content is unintentional? Unfortunately, search engines don’t take intent into
consideration when ranking sites, so identifying and editing duplicate content is necessary.

Unintentional duplicate content can happen for a number of reasons – secure HTTPS pages,
URL parameters, and CMS templates. Fortunately, many tools can detect duplicate content,
including Screaming Frog, Link Sleuth, and Moz Crawl Test. Once it is discovered, you have
to decide how to best to tell search engines not to index certain duplicate pages either through
the Noindex, Nofollow, or rel=canonical tags.

2. Bad backlinks
Though link building is still an important part of SEO, not all links are good links. Bad
backlinks, such as links from irrelevant pages, link directories, and spammy websites, can
actually hurt your search-engine rankings.

To fix bad backlinks, gather your backlink data from Open Site Explorer or MajesticSEO and
remove links that look unnatural. This isn’t an easy feat as it is a very manual outreach
process asking webmasters to remove links on their site. But it is imperative to uphold your
search-engine rankings and credibility in Google’s eyes. Also, use Google’s link disavow
tool to tell Google not to consider certain links when ranking your site.

3. Over-optimization and cannibalization of target


keywords
Though putting your target keywords on every page may seem like a great idea, it can be
damaging to your SEO strategy. Think about it: Search engines need to display the most
relevant page based on a search query. If you have multiple pages optimized for the same
target keyword, you’re leaving it up to the search engine to decide which page to show users.

Over-optimization and cannibalization can be remedied through a robust canonical SEO


strategy, which clearly assigns a keyword to a sole canonical page. This sends a clear
message to search engines as to which page is the most relevant for a given keyword and is a
better experience for the user, as the most pertinent page will be displayed.

4. Titles and title tags


Web page titles and title tags are important for several reasons: Title tags can help with page
rankings, the title shows up in the search engine results page (SERP) itself, and the title is
shown when the page is shared on social sites like Twitter and Facebook.
There are many common mistakes associated with titles and title tags, including:

 Too long: Search engines only display the first 60 or so characters of a web page title
tag, so a title tag that’s too long will be cut off.
 Too short: Though you don’t want the tag to be cut off, you also want to make sure
to maximize the available text space so you don’t give up prime SEO real estate.
 Irrelevant/wasted space: Including words like “home” or your domain name can be
a waste of space. With a finite number of characters, your title tag needs to include the
most important information – the relevant keyword/term for that specific page.

5. Meta descriptions
Similar to a title tag, the page’s meta description is displayed on the query’s results page.
However, all too often pages have poorly written meta descriptions that are full of keywords,
or worse, no meta description at all.

A good meta description is useful to the reader, and should explain what the page is about in
a short sentence. It should include the primary keyword or phrase, but still make sense to the
person reading it.

6. Image optimization
Image optimization is also a significant part of an SEO strategy. Search engines can’t read
images (unlike text) so they aren’t easily indexable. Best practices include optimizing image
meta data with relevant keywords and phrases:

 Alt tags serve as the text shown when an image cannot be displayed because of a slow
internet connection or text-reading software. The alt tag explains what the image is.
 Image tags are the words that appear when the user scrolls over an image, providing
additional contextual clues.
 File names go one step further in providing context – more specifically, how the
image relates to the other content on the page.

7. Page-load time
Page-load time is one of the 200 ranking factors that Google uses. However, page-load time
also is a huge factor in usability; if a page takes too long to load, users won’t stick around.

There are many ways to optimize page-load time, including using appropriate image sizes
and formats, avoiding unnecessary plug-ins, CSS, and HTML, and reducing redirects.

8. Poor content
Thin content and/or disregard for the user are the more common mistakes we see. Write
more. Answer your audiences’ questions through useful data, tips, and visuals. Since the first
Panda update, Google has been doing its best to disregard results that aren’t useful to users.
This can be easily combatted by always keeping the audience in mind when creating and
publishing content.

9. Keyword misfocus
Keyword misfocus is when a primary keyword in the title tag doesn’t match the H1 heading,
page URL, body content, or images. Page improvement and keyword misfocus can be
effectively corrected through strategic internal anchor text links, content consolidation, and
proper rel=”canonical” tag implementation to effectively strengthen the primary page with its
intended keyword.

10. Indexability issues


It’s simple: If a page can’t be indexed, it won’t be included in the SERPs. Everything from
blocked and missing pages to broken links and redirects can cause indexabilty issues, making
it crucial for you to consistently monitor each page. If a search engine cannot get to your
page, neither can your users. As a result, the page won’t be indexed or viewed, which can
cause an increase in bounce rate and a decrease in traffic.

Each of these 10 SEO pitfalls can result in lower website rankings, as well as a poor user
experience. From unintentional duplicate content and bad backlinks to slow page-load time
and low-quality content, all are fixable. Without these mistakes holding you back, your
website will be on its way to the top of the SERPs.

You might also like