Web 2.0 means different things to different people. Here, it refers to the designs and technologies used to implement modern, user-friendly Rich Internet Application ( RIA ) sites.
However this doesn't include any of the third-party 'eye-candy' libraries and frameworks that currently exist, such as JQuery. These contribute little or nothing to usability while bloating page sizes and slowing down site loading.
This site provides working examples of designing and developing web sites without using these libraries and frameworks, and without relying on features in specific HTML versions beyond HTML 4.01. The focus is on building usable web sites, with design and coding blended in a practical, state-of-the-art guide to creating cross-browser Web 2.0 RIA sites in the simplest way that achieves the desired end result.
The web site architecture used here to implement Rich Internet Applications is pragmatic. A single code base is used for cross browser-compatible Web 2.0 RIA 'Master Pages' that pass W3C validation.
These master web pages consist of HTML and CSS structural skeletons, and content that is pre-loaded, and loaded with Asynchronous JavaScript And XML ( AJAX ), that's swapped into and out of view as users navigate sites. The content swapping is accomplished by manipulating the Document Object Model ( DOM ) with JavaScript.
Server-side code should only run functions that absolutely must execute on back-ends, such as database SQL queries. And the use of back-end pages to write front-end pages' structure to browsers should be avoided, and they should just write the server-side data they access to front-end pages that load this content into the appropriate section of the page / site.
Whatever type of server-side pages are employed, client-side browsers use the DOM to swap old content out of view, format and write new content to front-ends, and swap new content into view. Examples show returned data from partial and whole HTML pages, database SQL query results from PHP pages, remote domain mashups, information delivered in data arrays such as .CSV and JASON, and more.
Many different browser vendors and versions exist, so cross-browser solutions are provided that run in Internet Explorer ( IE ) 6, 7, 8, 9, 10, and 11, Firefox, Chrome, Opera, and Safari, under various Operating Systems, without third party libraries or frameworks.
HTML is fault-tolerant, with its ability to ignore new entities that will be defined in future releases of HTML, and that current and older versions cannot render. And the concepts of fault-tolerance and avoidance, internally in web page code, are covered.
Defensive coding practices that handle unexpected situations are covered. Examples of avoiding JavaScript programming issues, such as math rounding errors and problems due to improper use of JavaScript keywords like 'this', are provided, as are using a JavaScript subset to avoid problems with other keywords, such as 'with'. And ways to avoid security issues like SQL injection and cross-site scripting are looked at.
Working examples from the companion book are shown on this site, with detailed explanations in the book. These are written in HTML, JavaScript, AJAX, and CSS on the front-end, and PHP for file and database accesses, and cross-domain mashups, on the back-end. None of these software packages require source code compilation, either initially or when code changes.
Dividing functionality between front-end UI code, server-side code and databases, and graphics production and design, will be discussed. And the use of version control, both locally on development systems, and on servers used for hosting, will also be covered
The latest versions of HTML and CSS attempt to combine aspects of the numerous frameworks, libraries, and product versions, in new standards by including some of their features in the core language specification of HTML 5 and CSS 3, while maintaining backward compatibility with both HTML 4.01 and XHTML 1, and earlier versions of CSS. But the new capabilities of HTML 5 and CSS do not work in legacy browsers that only support older versions, such as HTML 4.01 and CSS 2.
JavaScript
The defacto language standard for adding interactivity to web pages is JavaScript, and it's
a lot more cross-browser compatible than HTML and CSS.
The various different browsers in use worldwide are as follows:
Source : thenextweb.com
As you can see from the graphic, IE 6 still has more users than either Opera or Safari. So,
unless you intend to focus on just one or two browsers and ignore everything else, you will
have to deal with all 9 browsers, IE 6, 7, 8, 9, and 10, Firefox, Chrome, Opera, and Safari.
Of these, by default Firefox, Chrome, Opera, and Safari have ( more or less ) automatic updates, so only the current versions of these should need to be supported, along with the 5 versions of IE that you are likely to encounter ( at least, until the next version is released ).
PHP is the most widely used server-side language, although there are a number of others, such as
C# and Perl.
So we will focus in this book on using PHP to run parts of applications that need to
execute on the server, such as executing SQL queries on databases.