Beruflich Dokumente
Kultur Dokumente
Project PG
Project PG
PAGE 1
(content management system) here used is Wordpress. The Rabh helping hands website
developed using PHP (preprocessor hypertext language) as the Front End and MYSQL as
the Back End
1.3About workplace
Next Big Technology (NBT) is a premium web development and web design firm since
2009. NBT always aims at infusion of latest technologies for advancements of website
development. As a website applications development company we know how a website
can take off with proper design, programming! NBT is based at Jaipur, Rajasthan,
India with a team of 35+ Professionals with assorted skill sets. NBT is formulated to
serve society by providing Web products and IT services. We provide a full range of web
services with expertise in Website Design, Website Development, Website Maintenance,
Website Redesign, Offshore Outsourcing, Ecommerce Web Development, CMS Web
Development etc.
The owner of the company is Mr. Amit Shukla. I worked under Mr. Ajay Sharma
Manager of the company.
Next Big Technology is a website designing, web development, Software Consulting,
specializing in creating custom web designing, web development commerce
development, web solutions, search engine optimization & social media marketing
solutions. We provide quality web design solutions and create professional websites with
fresh and innovative web design ideas. we offer includes website design, redesign, CMS
(Content Management System), CSS web design, open source ecommerce websites,
personal web pages, custom template design, open source shopping carts, blogs, custom
web design, website maintenance, seo (search engine optimization) and much more.
Next Big Technology has gained a reputation of delivering quality services by the time
critical solution and its just because of our dedicated team. We deal in web development,
software development, mobile application development like android based application, IPhone application, blackberry application and other mobile application development,
PAGE 2
PAGE 3
2.2.1 Construction
The author
was
tasked with
and CSS.
The former was used for structure and the latter for the styling of the website. This
method not only reduces the overall page size, it also easier to edit and maintain.
HTML
(Hyper Text
Markup Language)
should be written
i.e.
all
tags
in
lower case, correct nesting of tags and all tags to be closed properly. By using XHTML in
conjunction with a linked style sheet, the author has adhered to the W3C recommendation
that websites should now be built this way.
The author has used the div tag, as opposed to tables, to structure his layout this results
in a drastic reduction in the amount of code used. For optimal visual effect, the author has
nested the div tags to achieve his desired layout. For instance, the container div (as its
name suggests)
contains
all
other divs.
Each
separate part of
the layout
is
structure.
This
method enables
be styled by
a single stylesheet. Thus, any changes made to the stylesheet are replicated throughout
the site,
therefore making it
easier to update
and edit.
Also,
the author
has
used a small amount of CSS inline (within the actual element on the XHTML page)
PAGE 5
to indicate which page the user is on. The rest of the navigation makes use of
a simple text colour rollover. The vertical navigation on the left of the page also makes
use of colour rollovers. However, a rollover image has also been used. This image is
a small chevron placed vertically to the left of the text. When a mouse pointer hovers
over the text,
colour
is
swapped for
that of
a flashing chevron. This is achieved by setting the image as a background image within
the li for the link and positioning it to the left.
2.2.2 Coding
The whole website has been hand coded in XHTML and CSS, it is beneficial, not only
to the person who wrote the code, but also to anybody who looks at the code, to
have a layout to some degree. For the XHTML, the author has left aligned all elements
except for the navigation areas. In addition, author has left white space after the start
and at the end of a div resulting in a uniform appearance of the code. In the case of
the CSS, the author has grouped elements together i.e. layout, navigation and form area
it
has
clearly
document
different
the author
This
makes
sections
that
has
inserted a
look
at
up the stylesheet.
In
comment
to
next
to
each
closing div tag to highlight which div it belongs to. This is useful (especially when
nesting divs) as the bottom of the page can end up having several closing div tags. In
the CSS document the author has highlighted each section with an appropriate comment
i.e. side navigation for the vertical navigation. Furthermore, in the case of workarounds,
the author has stated what that certain piece of code is for.
2.2.3 Compatibility
For
a website to be acceptable it
was
necessary
to check that
it
works
in
Internet Explorer 6
Mozilla Firefox 1.07
PAGE 6
chrome
Opera 8
to how well
his
site has
been
designed.
Accessibility
Making the website accessible as well as aesthetically pleasing is quite hard to do.
The author has, she feels, managed to strike a balance between the two. For instance,
the navigation and links within pages have a tab index assigned to them and the contact
form specifies which language it is written in.
the images
that
see,
want
any
fancy decorative features distracting them. Image size Apart from the header all images
have the same width
as
each
in
other
this
is
to
promote uniformity
have their
across
own dimensions
PAGE 7
2.2.7 Compression
Not including the animated GIF, all the images used in the website are photographs,
therefore the best format for them is JPG. The author has kept them at a high resolution
as
she didnt
want
the images
to
lose any of
their
clarity however,
file size
by
optimizing
them
in
Macromedia Fireworks.
Photo gallery demonstrates the ability to make images appear when a user positions
a mouse over a smaller image.
property
in
to
reveal
a larger version
of
enables
the picture.
All
a user
small
thumbnail images are of the same size, and the larger images are of a similar size to each
other. Copyright All images used in the website are the authors own.
PAGE 8
2.2.10 Validation
The website is valid XHTML and was validated via the W3C website. The CSS did not
validate as according to the W3C website it could not be parsed correctly. All the forms
are validated including contact us form and login form.
2.2.11 Plugins
The author has used the plugins for the forms and other functions to make the site user
friendly as well as easy to maintain for the developer. It includes the plugins for FAQ
(frequently asked questions) page, contact us page, testimonials, login page etc.
Yoast is a plugin used to provide search engine optimization to the site. Some more
helpful plugin are also used to maintain the members information.
2.3 Scope
Recently the website has content related to Special kids who are suffering with cerebral
palsy, autism. The main idea behind making the website is make available the
information about cerebral palsy.
2.4 Features
PAGE 9
PAGE 10
The CMS I am using for my project is WordPress. I have used both customized and
WordPress theme. WordPress is definitely the world's most popular CMS. The script is in
its roots more of a blog than a typical CMS. For a while now it's been modernized and it
got thousands of plugins, what made it more CMS-like.
The script as an Open Source is the first choice for most bloggers, but it can also be
successfully used for designing simple websites.
3.2 Advantages
Easy, easy, easy ...
WordPress does not require PHP nor HTML knowledge unlike Drupal, Joomla or Typo3.
A preinstalled plugin and template function allows them to be installed very easily. All
you need to do is to choose a plugin or a template and click on it to install.
It's good choice for beginners.
Community
To have a useful support, there must be a large community of users, who will be a part of
e.g. a discussion board.
Plugins
The script has over dozen thousands of plugins available on its website. They are the
reason WordPress is considered a CMS, not only a blogging script. Strong majority of the
plugins is available for free.
PAGE 11
Templates
On the scripts homepage you can view thousands of graphics templates, that can change
your website's look. You can find there both free and paid templates. The paid ones are
often more advanced as well as more interesting.
Menu management
WordPress menu management has extended functionalities, that can be modified to
include categories, pages, etc.
Non-standard fields
You can easily add fields to forms by yourself or using plugins. It will allow your blog or
subpages to have additional labels, categories or descriptions.
3.3 Disadvantages
Modification requires knowledge of PHP
Operations like removing a date field requires some understanding of PHP language. It is
the case for most of such modifications.
PAGE 12
PHP security
The script is not protected as well as other applications. It all depends on how sesitive is
the additional content of your page.
SQL queries
Queries can be complex since all additional non-standard fields that make WordPress a
CMS, require additional syntax.
PAGE 13
Conclusions
WordPress is a very good script to create a simple website. It is one of the simplest to use
(definitely not simpler than Quick. CMS though) of all solutions available on the internet.
It's very good choose for a beginner's. Advanced users with advanced needs would have
to install many plugins to have what is a standard for Joomla or Drupal.
4.1 Introduction
PHP: Hypertext Pre-processor is a widely used, general-purpose scripting language
that was initially designed for web development to produce dynamic web pages. For this
purpose, PHP code is embedded into the HTML source document and interpreted by a
web server with a PHP processor module, which generates the web page document. As a
general-purpose programming language, PHP code is processed by an interpreter
application in command-line mode performing desired operating system operations and
producing program output on its standard output channel. It may also function as a
graphical application. PHP is available as a processor for most modern web servers and
as a standalone interpreter on most operating systems and computing platforms.
PHP was originally created by Rasmus Lerdorf in 1995 and has been in continuous
development ever since. The main implementation of PHP is now produced by the PHP
Group and serves as the de facto standard for PHP as there is no formal specification.
PHP is free software released under the PHP License.
4.2 History
PHP originally stood for personal home page. Its development began in 1994 when the
Danish/Greenlandic programmer Rasmus Lerdorf initially created a set of Perl scripts he
PAGE 14
called 'Personal Home Page Tools' to maintain his personal homepage, including tasks
such as displaying his resume and recording how much traffic his page was receiving.
He rewrote these scripts as C programming language Common Gateway Interface (CGI)
binaries, extending them to add the ability to work with web forms and to communicate
with databases and called this implementation 'Personal Home Page/Forms Interpreter' or
PHP/FI. PHP/FI could be used to build simple, dynamic web applications. Lerdorf
released PHP/FI as 'Personal Home Page Tools (PHP Tools) version 1.0' publicly on June
8, 1995, to accelerate bug location and improve the code. This release already had the
basic functionality that PHP has today. This included Perl-like variables, form handling,
and the ability to embed HTML. The syntax was similar to Perl but was more limited and
simpler, although less consistent. A development team began to form and, after months of
work and beta testing, officially released PHP/FI 2 in November 1997.
Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the
parser in 1997 and formed the base of PHP 3, changing the language's name to the
recursive initialism PHP: Hypertext Pre-processor. Afterwards, public testing of PHP 3
began, and the official launch came in June 1998. Suraski and Gutmans then started a
new rewrite of PHP's core, producing the Zend Engine in 1999. They also founded Zend
Technologies in Ramat Gan, Israel.php
On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. As of August
2008 this branch is up to version 4.4.9. PHP 4 is no longer under development nor will
any security updates be released.
On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5
included new features such as improved support for object-oriented programming, the
PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface
for accessing databases), and numerous performance enhancements. In 2008 PHP 5
became the only stable version under development. Late static binding had been missing
from PHP and was added in version 5.3.
A new major version has been under development alongside PHP 5 for several years.
This version was originally planned to be released as PHP 6 as a result of its significant
PAGE 15
changes, which included plans for full Unicode support. However, Unicode support took
developers much longer to implement than originally thought, and the decision was made
in March 2010 to move the project to a branch, with features still under development
moved to a trunk.
Many high-profile open-source projects ceased to support PHP 4 in new code as of
February 5, 2008, because of the GoPHP5 initiative, provided by a consortium of PHP
developers promoting the transition from PHP 4 to PHP 5.
PHP currently does not have native support for Unicode or multibit strings Unicode
support is under development for a future version of PHP and will allow strings as well as
class, method, and function names to contain non-ASCII characters.
PHP interpreters are available on both 32-bit and 64-bit operating systems, but on
Microsoft Windows the only official distribution is a 32-bit implementation, requiring
Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a
64-bit Windows platform. As of PHP 5.3.0, experimental 64-bit versions are available for
MS Windows.
4.3 Licensing
PHP is free software released under the PHP License, which insists that:
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
PAGE 16
5.1 Introduction
MySQL is a relational database management system (RDBMS) that runs as a server
providing multi-user access to number of databases. MySQL is officially pronounced
/maskjul/ ("My S-Q-L"), but is often also pronounced /masi kwl/ ("My Sequel").
It is named for original developer Michael Widenius' daughter My.
The MySQL development project has made its source code available under the terms of
the GNU General Public License, as well as under a variety of proprietary agreements.
MySQL was owned and sponsored by a single for-profit firm, the Swedish company
MySQL AB, now owned by Oracle Corporation.
Members of the MySQL community have created several forks (variations) such as
Drizzle, OurDelta, Percona Server, and MariaDB. All of these forks were in progress
before the Oracle acquisition (Drizzle was announced 8 months before the Sun
acquisition).
Free-software projects that require a full-featured database management system often use
MySQL. Such projects include (for example) WordPress, phpBB, Drupal and other
software built on the LAMP software stack. MySQL is also used in many high-profile,
large-scale World Wide Web products including Wikipedia, Google and Facebook.
MySQL is an open source, SQL Relational Database Management System (RDBMS) that
is free for many uses. However, MySQL found a broad, enthusiastic user base for its
PAGE 17
liberal licensing terms, perky performance, and ease of use. Its acceptance was aided in
part by the wide variety of other technologies such as PHP, Java, Perl, Python, and the
like that have encouraged its use through stable, well-documented modules and
extensions. MySQL has not failed to reward the loyalty of these users with the addition of
both sub selects and foreign keys.
http://dev.mysql.com/doc/refman/4.1/en/news-3-23-x.html
B.2. Changes in Release 4.0.x (Lifecycle Support Ended)
http://dev.mysql.com/doc/refman/4.1/en/news-4-0-x.html
C.1. Changes in Release 5.0.x (Production)
http://dev.mysql.com/doc/refman/5.0/en/news-5-0-x.html#news-5-0-x
C.1. Changes in Release 5.5.x (Development)
http://dev.mysql.com/doc/refman/5.5/en/news-5-5-x.html#news-5-5-x
Databases in general are useful, arguably the most consistently useful family of software
productsthe killer product of modern computing. Like many competing products,
both free and commercial, MySQL isnt a database until you give it some structure and
form. You might think of this as the difference between a database and an RDBMS (that
is, an RDBMS plus user requirement equals a database).
A database adds another layer of security if used with its own password or passwords.
To create a database from PHP, the user of your scripts will need to have full
CREATE/DROP privileges on MySQL. That means anyone who can get hold of your
scripts can potentially blow away all your databases and their contents with the greatest
of ease. This is not such a great idea from a security standpoint. Furthermore, most
external Web hosts very sensibly wont let you do it on their servers anyway.
MySQL is one of the easiest databases to administer on all platforms and because its so
lightweight, it can run on even low powered PCs. Thus, PHP developers have long found
it convenient to throw a copy of MySQL on client machineseven on laptopsfor a
complete local Web development environment. Many developers learn to run their own
MySQL installations so they can work at home or on the road, using the OS of their
choice. Work teams also sometimes prefer developers to each use a separate local
MySQL installation, so that there is no single point of failure that could affect an entire
PAGE 19
development group. And many PHP-based Open Source projects assume complete
familiarity with MySQL database administration for all developers.
Unlike some other databases, it should be well within the capability of any PHP
developer to self-administer a MySQL database Many PHP-based application packages,
both commercial and Open Source, also require familiarity with a MySQL database to
install, run, and debug the Web app.
PAGE 20
Customers that do not wish to follow the terms of the GPL may purchase a proprietary
license.
Like many open-source programs, MySQL has trademarked its name, which others may
use only with the trademark holder's permission.
PAGE 21
Apache HTTP Server for UNIX and Windows, Microsoft Internet Information Server,
and Netscape Enterprise Server (a.k.a. iPlanet Server).
PHP is a real programming language. PHP is pleasingly zippy in its execution, especially
when compiled as an Apache module on the UNIX side. The MySQL server, once started,
executes even very complex queries with huge result sets in record-setting time.
6.1 Introduction
The Apache HTTP Server, commonly referred to as Apache (pronounced /pti/), is
web server software notable for playing a key role in the initial growth of the World Wide
Web. In 2009 it became the first web server software to surpass the 100 million web site
milestone. Apache was the first viable alternative to the Netscape Communications
Corporation web server (currently known as Oracle iPlanet Web Server), and has since
evolved to rival other Unix-based web servers in terms of functionality and performance.
The majority of web servers using Apache run a Unix-like operating system.[citation
needed]
Apache is developed and maintained by an open community of developers under the
auspices of the Apache Software Foundation. The application is available for a wide
variety of operating systems, including UNIX, GNU, FreeBSD, Linux, Solaris, Novell
NetWare, Mac OS X, Microsoft Windows, OS/2, TPF, and eComStation. Released under
the Apache License, Apache is characterized as open-source software.
PAGE 22
Since April 1996 Apache has been the most popular HTTP server software in use. As of
February 2010 Apache served over 54.46% of all websites and over 66% of the million
busiest.
6.2 History
The pre-release versions (before 0.6.2) of the Apache web server software were created
by Robert McCool, who was heavily involved with the National Centre for
Supercomputing Applications web server, known simply as NCSA HTTPd. When
McCool left NCSA in mid-1994, the development of httpd stalled, leaving a variety of
patches for improvements circulating through e-mails. These patches were provided by a
number of other developers besides McCool: Brian Behlendorf, Roy Fielding, Rob
Hartill, David Robinson, Cliff Skolnick, Randy Terbush, Robert S. Thau, Andrew Wilson,
Eric Hagberg, Frank Peters and Nicolas Pioch, and they thus helped to form the original
"Apache Group". There have been two explanations of the project's name. According to
the Apache Foundation, the name was chosen out of respect for the Native American tribe
of Apache (Ind), well-known for their endurance and their skills in warfare. However,
the original FAQ on the Apache Server project's website, from 1996 to 2001, claimed that
"The result after combining [the NCSA httpd patches] was a patchy server. The first
explanation was supported at an Apache Conference and in an interview in 2000 by Brian
Behlendorf, who said that the name connoted "Take no prisoners. Be kind of aggressive
and kick some ass" Behlendorf then contradicted this in a 2007 interview, stating that
"The Apache server isn't named in honor of Geronimo's tribe" but that so many revisions
were sent in that "the group called it 'a patchy Web server'". Both explanations are
probably appropriate.
The system operates through the work of volunteers who specialize in certain areas of
coding. The Apache Group (AG) emphasizes decentralization and has a low
interdependency in the tasks they do. The AG is a multinational server, having developers
located in U.S., Britain, Canada, Germany, and Italy. Although Apache collaborates as a
PAGE 23
group, the work is done by individuals. Their decisions are a result of e-mail and quorum
voting system.
The very first version (0.6.2) of publicly distributed Apache was released in April 1995. A
new modular server architecture was written under the codename Shambhala, which
became version 0.8.0 released in mid July. The 1.0 version was released on December 1,
1995.
Version 2 of the Apache server was a substantial re-write of much of the Apache 1.x code,
with a strong focus on further modularization and the development of a portability layer,
the Apache Portable Runtime. The Apache 2.x core has several major enhancements over
Apache 1.x. These include UNIX threading, better support for non-Unix platforms (such
as Microsoft Windows), a new Apache API, and IPv6 support. The first alpha release of
Apache 2 was in March 2000, with the first general availability release on April 6, 2002.
Version 2.2 introduced a more flexible authorization API. It also features improved cache
modules and proxy modules.
6.3 Licensing
The software license under which software from the Apache Foundation is distributed is a
distinctive part of the Apache HTTP Server's history and presence in the open-source
software community. The Apache License allows for the distribution of both open and
closed source derivations of the source code.
The Free Software Foundation does not consider the Apache License to be compatible
with version 2 of the GNU General Public License (GPL) in that software licensed under
the Apache License cannot be integrated with software that is distributed under the GPL:
This is a free software license but it is incompatible with the GPL. The Apache Software
License is incompatible with the GPL because it has a specific requirement that is not in
the GPL: it has certain patent termination cases that the GPL does not require. We don't
PAGE 24
think those patent termination cases are inherently a bad idea, but nonetheless they are
incompatible with the GNU GPL.
However, version 3 of the GPL includes a provision (Section 7e) which allows it to be
compatible with licenses that have patent retaliation clauses, including the Apache
License. The name Apache is a registered trademark and may only be used with the
trademark holder's express permission.
7.1 Introduction
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and
has first-class functions. It is a multi-paradigm language, supporting object, imperative,
and functional programming styles.
JavaScript was formalized in the ECMAScript language standard and is primarily used in
the form of client-side JavaScript, implemented as part of a Web browser in order to
provide
enhanced user
interfaces and
dynamic websites.
This
use
in applications outside
Web
pages
for
example
Newer and faster JavaScript VMs and frameworks built upon them (notably Node.js)
have also increased the popularity of JavaScript for server-side web applications.
JavaScript uses syntax influenced by that of C. JavaScript copies many names and
naming conventions from Java, but the two languages are otherwise unrelated and have
very different semantics. The key design principles within JavaScript are taken from
the self and Scheme programming languages.
7.2 History
JavaScript was originally developed by Brendan Eich of Netscape under the
name Mocha, which was later renamed to LiveScript, and finally to JavaScript mainly
because it was more influenced by the Java programming language. LiveScript was the
official name for the language when it first shipped in beta releases of Netscape
Navigator 2.0 in September 1995, but it was renamed JavaScript in a joint announcement
with Sun Microsystems on December 4, 1995, when it was deployed in the Netscape
browser version 2.0B3.
The change of name from Live Script to JavaScript roughly coincided with Netscape
adding support for Java technology in its Netscape Navigator web browser. The final
choice of name caused confusion, giving the impression that the language was a spin-off
of the Java programming language, and the choice has been characterized by many as a
marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new
web programming language. It has also been claimed that the language's name is the
result of a co-marketing deal between Netscape and Sun, in exchange for Netscape
bundling Sun's Java runtime with its then-dominant browser.
JavaScript very quickly gained widespread success as a client-side scripting language for
web pages. As a consequence, Microsoft named its implementation of JScript to avoid
trademark issues. JScript added new date methods to fix the Y2K-problematic methods in
PAGE 26
7.3 Features
The following features are common to all conforming ECMAScript implementations,
unless explicitly specified otherwise.
PAGE 27
JavaScript
supports
much
of
the structured
programming syntax
from C (e.g., if statements, while loops, switch statements, etc.). One partial exception
is scoping: C-style block-level scoping is not supported (instead, JavaScript has functionlevel
scoping).
JavaScript
1.7,
Like
C,
however,
supports
JavaScript
block-level
makes
scoping
with
distinction
7.3.2 Dynamic
dynamic typing
As in most scripting languages, types are associated with values, not with variables. For
example, a variable x could be bound to a number, then later rebound to a string.
JavaScript supports various ways to test the type of an object, including duck typing.
object based
JavaScript is almost entirely object-based. JavaScript objects are associative arrays,
augmented with prototypes (see below). Object property names are string
keys: obj.x = 10 andobj['x'] = 10 are equivalent, the dot notation being syntactic sugar.
Properties and their values can be added, changed, or deleted at run-time. Most properties
of an object (and those on its prototype inheritance chain) can be enumerated using
a for...in loop.
JavaScript
has
small
number
of
built-in
objects
such
run-time evaluation
JavaScript includes an eval function that can execute statements provided as strings at
run-time.
PAGE 28
7.3.3 Functional
First-class functions
Functions are first-class they are objects themselves. As such, they have properties and
methods, such as length and call () and they can be assigned to variables, passed as
arguments,return-ed by other functions, and manipulated like any other object. Any
reference to a function allows it to be invoked using the () operator.
Nested functions
"Inner" or "nested" functions are functions defined within another function. They are
created each time the outer function is invoked. In addition to that, the scope of the outer
function, including any constants, local variables and argument values, become part of
the internal state of each inner function object, even after execution of the outer function
concludes.
Closures
JavaScript allows nested functions to be created, with the lexical scope in force at their
definition, and has a () operator to invoke them now or later. This combination of code
that can be executed outside the scope in which it is defined, with its own scope to use
during that execution, is called a closure in computer science.
7.3.4 Prototype-based
Prototypes
JavaScript uses prototypes instead of classes for inheritance. It is possible to simulate
many class-based features with prototypes in JavaScript.
PAGE 29
bound to that object for that invocation. The constructor's prototype property determines
the object used for the new object's internal prototype. JavaScript's built-in constructors,
such as Array, also have prototypes that can be modified.
Functions as methods
Unlike many object-oriented languages, there is no distinction between a function
definition and a method definition. Rather, the distinction occurs during function calling
a function can be called as a method. When a function is called as a method of an object,
the function's local this keyword is bound to that object for that invocation.
7.3.5 Miscellaneous
Run-time environment
JavaScript typically relies on a run-time environment (e.g. in a web browser) to provide
objects and methods by which scripts can interact with "the outside world". In fact, it
relies on the environment to provide the ability to include/import scripts
(e.g. HTML <script> elements). (This is not a language feature per se, but it is common
in most JavaScript implementations.)
Variadic functions
An indefinite number of parameters can be passed to a function. The function can access
them through formal parameters and also through the local arguments object.
Regular expressions
PAGE 30
JavaScript also supports regular expressions in a manner similar to Perl, which provide a
concise and powerful syntax for text manipulation that is more sophisticated than the
built-in string functions.
Opening or popping up a new window with programmatic control over the size,
position, and attributes of the new window (e.g. whether the menus, toolbars, etc., are
visible).
Validating input values of a web form to make sure that they are acceptable before
being submitted to the server.
Changing images as the mouse cursor moves over them: This effect is often used
to draw the user's attention to important links displayed as graphical elements.
Transmitting information about the user's reading habits and browsing activities to
various
websites.
Web
pages
frequently
do
this
for web
analytics, ad
PAGE 31
engine (also
known
as JavaScript
interpreter or JavaScript
implementation)
is
an interpreter that interprets JavaScript source code and executes the script accordingly.
The first JavaScript engine was created by Brendan Eich at Netscape Communications
Corporation,
for
the Netscape
Navigator web
browser.
The
engine,
code-
named SpiderMonkey, is implemented in C. It has since been updated (in JavaScript 1.5)
to conform to ECMA-262 Edition 3. The Rhino engine, created primarily by Norris Boyd
(formerly of Netscape now at Google) is a JavaScript implementation in Java. Rhino,
like SpiderMonkey, is ECMA-262 Edition 3 compliant.
A web browser is by far the most common host environment for JavaScript. Web
browsers typically use the public API to create "host objects" responsible for reflecting
the Document Object Model (DOM) into JavaScript. The web server is another common
application of the engine. A JavaScript webserver would expose host objects representing
an HTTP request and response objects, which a JavaScript program could then
manipulate to dynamically generate web pages.
Because JavaScript is the only language that the most popular browsers share support for,
it has become a target language for many frameworks in other languages, even though
JavaScript was never intended to be such a language. Despite the performance limitations
inherent to its dynamic nature, the increasing speed of JavaScript engines has made the
language a surprisingly feasible compilation target.
7.5 Versions
The following table is based on a history compilation forum post, JQuery author's blog
post, and Microsoft's JScript version information webpage.
Versi Release
on
date
Equivalent to
Opera Safari
Google
Chrome
PAGE 32
1.0
1.1
1.2
1.3
March
2.0
1996
August
3.0
3.0
1996
June 1997
4.0-4.05
October
ECMA-262 1st +
1998
2nd edition
4.06-4.7x
4.0
Netscape
1.4
Server
5.5
(JScript
5.5),
1.5
November ECMA-262
2000
3rd
edition
6 (JScript
6.0
1.0
5.6),
7 (JScript
6.0
3.0-5
1.010.0.666
5.7),
8 (JScript
5.8)
1.6
November
2005
1.5
generics + E4X
PAGE 33
1.7
1.6 + Pythonic
October
generators
2006
2.0
iterators + let
1.7
1.8
+ generator
3.0
11.50
ression closures
1.8
1.8.1
+ native
JSON support
3.5
minor updates
1.8.2
1.8.5
June
22, 1.8.1
2009
July
2010
minor
updates
27,
3.6
1.8.2
+ ECMAScript 5
11.60
compliance
Chapter 8: XHTML
8.1 Introduction
PAGE 34
8.2 Overview
XHTML 1.0 is "a reformulation of the three HTML 4 document types as applications of
XML 1.0". The World Wide Web Consortium (W3C) also continues to maintain the
HTML 4.01 Recommendation, and the specifications for HTML5 and XHTML5 are
being actively developed. In the current XHTML 1.0 Recommendation document, as
published and revised to August 2002, the W3C commented that, "The XHTML family is
the next step in the evolution of the Internet. By migrating to XHTML today, content
developers can enter the XML world with all of its attendant benefits, while still
remaining confident in their content's backward and future compatibility."
However,
in
2004,
the Web
Hypertext
Application
Technology
Working
PAGE 35
standards such as XHTML 2. In 2007, the W3C's HTML working group voted to
officially recognize HTML5 and work on it as the next-generated HTML standard. In
2009, the W3C allowed the XHTML 2 Working Group's charter to expire, acknowledging
that HTML5 would be the sole next-generation HTML standard, including both XML and
non-XML serializations. Of the two serializations, the W3C suggests that most authors
use the HTML syntax, rather than the XHTML syntax.
8.3 Motivation
XHTML
was
developed
to
make
HTML
increase interoperability with other data formats. HTML 4 was ostensibly an application
of Standard (SGML) however the specification for SGML was complex, and neither web
browsers nor the HTML 4 Recommendation were fully conformant to it. The XML
standard, approved in 1998, provided a simpler data format closer in simplicity to HTML
4. By shifting to an XML format, it was hoped HTML would become compatible with
common XML tools. servers and proxies would be able to transform content, as
necessary, for constrained devices such as mobile phones. By utilizing namespaces,
XHTML documents could provide extensibility by including fragments from other XMLbased languages such as Scalable Vector Graphics and MathML. Finally, the renewed
work would provide an opportunity to divide HTML into reusable components (XHTML
Modularization) and clean up untidy parts of the language.
PAGE 36
generally XHTML's XML syntax is a little more expressive than HTML (for example,
arbitrary namespaces are not allowed in HTML). So, firstly one source of differences is
immediate: XHTML uses an XML syntax, while HTML uses a pseudo-SGML syntax
(officially SGML for HTML 4 and under, but never in practice, and standardised away
from SGML in HTML5). Secondly however, because the expressible contents of the
DOM in syntax are slightly different, there are some changes in actual behavior between
the two models.
Firstly then, syntax differences:
Broadly, the XML rules require that all elements be closed, either by a separate
closing tag or using self closing syntax (e.g. <br />), while HTML syntax permits
some elements to be unclosed because either they are always empty (e.g. <input>) or
their end can be determined implicitly ("omissibility", e.g. <p>).
XML is case-sensitive for element and attribute names, while HTML is not.
Some shorthand features in HTML are omitted in XML, such as (1) attribute
minimization, where attribute values or their quotes may be omitted (e.g. <option
selected> or <option selected=selected>, while XML this must be expressed
as <option selected="selected">) (2) element minimization may be used to remove
elements entirely (such as <tbody>inferred in a table if not given) and (3) the rarely
used SGML syntax for element minimization ("shorttag"), which most browsers do
not implement.
Secondly, in contrast to these minor syntactical differences, there are some behavioral
differences, mostly arising from the underlying differences in serialization. For example:
PAGE 37
Most prominently, behavior on parse errors differ. A fatal parse error in XML
(such as an incorrect tag structure) causes document processing to be aborted.
Most content requiring namespaces will not work in HTML, except the built-in
support for SVG and MathML in the HTML5 parser along with certain magic
prefixes such as xlink.
CSS is also applied slightly differently. Due to XHTML's case-sensitivity, all CSS
selectors become case sensitive for XHTML documents. Some CSS properties, such
as backgrounds, set on the<body> element in HTML are 'inherited upwards' into
the <html> element this appears not to be the case for XHTML.
8.5 Adoption
The similarities between HTML 4.01 and XHTML 1.0 led many web sites and content
management systems to adopt the initial W3C XHTML 1.0 Recommendation. To aid
authors in the transition, the W3C provided guidance on how to publish XHTML 1.0
documents in an HTML-compatible manner, and serve them to browsers that were not
designed for XHTML.
Such "HTML-compatible" content is sent using the HTML media type (text/html) rather
than the official Internet media type for XHTML (application/xhtml+xml). When
measuring the adoption of XHTML to that of regular HTML, therefore, it is important to
PAGE 38
distinguish whether it is media type usage or actual document contents that is being
compared.
Most web browsers have mature support for all of the possible XHTML media types. The
notable exception is Internet Explorer versions 8 and earlier by Microsoft rather than
rendering application/xhtml+xml content, a dialog box invites the user to save the content
to disk instead. Both Internet Explorer 7 (released in 2006) and Internet Explorer 8
(released in March 2009) exhibit this behaviour. Microsoft developer Chris Wilson
explained in 2005 that IE7s priorities were improved browser security and CSS support,
and that proper XHTML support would be difficult to graft onto IEs compatibilityoriented HTML parser however, Microsoft added support for true XHTML in IE9.
As long as support is not widespread, most web developers avoid using XHTML that is
not HTML-compatible, so advantages of XML such as namespaces, faster parsing and
smaller-footprint browsers do not benefit the user.
8.6 Versions
XHTML 1.0
December 1998 saw the publication of a W3C Working Draft entitled Reformulating
HTML in XML. This introduced Voyager, the codename for a new markup language
based on HTML 4, but adhering to the stricter syntax rules of XML. By February 1999
the name of the specification had changed to XHTML 1.0: The Extensible HyperText
Markup Language, and in January 2000 it was officially adopted as a W3C
Recommendation. There are three formal DTDs for XHTML 1.0, corresponding to the
three different versions of HTML 4.01:
XHTML 1.0 Strict is the XML equivalent to strict HTML 4.01, and includes
elements and attributes that have not been marked deprecated in the HTML 4.01
PAGE 39
specification. As of May 25 2011, XHTML 1.0 Strict is the document type used for
the homepage of the website of the World Wide Web Consortium.
XHTML 1.0 Transitional is the XML equivalent of HTML 4.01 Transitional, and
includes the presentational elements (such as center,font and strike) excluded from
the strict version.
XHTML 1.0 Frameset is the XML equivalent of HTML 4.01 Frameset, and
allows for the definition of frameset documentsa common Web feature in the late
1990s.
The second edition of XHTML 1.0 became a W3C Recommendation in August 2002.
9.1 Introduction
A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML
content from its style. As always you use your (X)HTML file to arrange the content, but
all of the presentation (fonts, colors, background, borders, text formatting, link effects &
so on) are accomplished within a CSS.
At this point you have some choices of how to use the CSS, either internally or
externally.
INTERNAL STYLESHEET
First we will explore the internal method. This way you are simply placing the CSS code
within the <head></head> tags of each (X)HTML file you want to style with the CSS.
The format for this is shown in the example below.
PAGE 40
<head>
<title><title>
<style
type=text/css>
CSS
Content
Goes
Here
</style>
</head>
<body>
With this method each (X)HTML file contains the CSS code needed to style the page.
Meaning that any changes you want to make to one page, will have to be made to all.
This method can be good if you need to style only one page, or if you want different
pages to have varying styles.
EXTERNAL STYLESHEET
Next we will explore the external method. An external CSS file can be created with any
text or HTML editor such as Notepad or Dreamweaver. A CSS file contains no
(X)HTML, only CSS. You simply save it with the .css file extension. You can link to the
file externally by placing one of the following links in the head section of every
(X)HTML file you want to style with the CSS file.
<link rel=stylesheet type=text/css href=Path To stylesheet.css />
Or you can also use the @import method as shown below
<style type=text/css>@import url(Path To stylesheet.css)</style>
Either of these methods are achieved by placing one or the other in the head section as
shown in example below.
<head>
<title><title>
<style
type=text/css> @import
url(Path
To
stylesheet.css)</style>
PAGE 41
</head>
<body>
By using an external style sheet, all of your (X)HTML files link to one CSS file in order
to style the pages. This means, that if you need to alter the design of all your pages, you
only need to edit one .css file to make global changes to your entire website.
Here are a few reasons this is better.
Easier Maintenance
Reduced Bandwidth
Improved Flexibility
CASCADING ORDER
In the previous paragraphs, I have explained how to link to a css file either internally or
externally. If you understood, than I am doing a good job. If not dont fret, there is a long
way to go before we are finished. Assuming you have caught on already, you are
probably asking, well can I do both? The answer is yes. You can have both internal,
external, and now wait a minute a third way? Yes inline styles also.
Inline Styles
I have not mentioned them until now because in a way they defeat the purpose of using
CSS in the first place. Inline styles are defined right in the (X)HTML file along side the
element you want to style. See example below.
<p style=color: #ff0000>Some red text</p>
PAGE 42
Inline styles will NOT allow the user to change styles of elements or text formatted this
way
So, which is better?
So with all these various ways of inserting CSS into your (X)HTML files, you may now
be asking well which is better, and if I use more than one method, in what order do these
different ways load into my browser?
All the various methods will cascade into a new pseudo stylesheet in the following
order:
1.
2.
3.
As far as which way is better, it depends on what you want to do. If you have only one
file to style then placing it within the <head></head> tags (internal) will work fine.
Though if you are planning on styling multiple files then the external file method is the
way to go.
Choosing between the <link related=> & the @import methods are completely up to you.
I will mention that the @import method may take a second longer to read the CSS file in
Internet Explorer than the <link related=> option. To combat this see Flash of unstyled
content
PAGE 43
POWER USERS
Swapping stylesheets is beneficial not only for users with disabilities, but also power
users who are particular about how they read Web documents.
BROWSER ISSUES
You will discover as you delve farther into the world of CSS that all browsers are not
created equally, to say the least. CSS can and will render differently in various browsers
causing numerous headaches.
PAGE 44