Affichage des articles dont le libellé est Tutorial HTML. Afficher tous les articles

JavaScript Basics & HTML DOM / PDF



JavaScript Basics & HTML DOM / PDF



JavaScript Basics & HTML DOM / PDF




Table of Contents


• What is and Why JavaScript?
• How and Where do you place JavaScript code?
• JavaScript language
• JavaScript functions
• JavaScript events
• JavaScript objects
• JavaScript HTML DOM objects
• Closure (need to be added)



------------------------


Sample of the PDF document 







What is JavaScript?

• Was designed to add interactivity to HTML pages
• Is a scripting language (a scripting language is a lightweight programming language)
• JavaScript code is usually embedded directly into HTML pages
• JavaScript is an interpreted language (means that scripts execute without preliminary compilation)



What can a JavaScript do?

• JavaScript gives HTML designers a programming tool
• JavaScript can put dynamic text into an HTML page
• JavaScript can react to events
• JavaScript can read and write HTML elements
• JavaScript can be used to validate input data
• JavaScript can be used to detect the visitor's browser
• JavaScript can be used to create cookies


How to put a JavaScript code into an HTML page?

• Use the







Where Do You Place Scripts?

• Scripts can be in the either section or section
• Convention is to place it in the section




.............





Download JavaScript Basics & HTML DOM / PDF




JavaScript Basics & HTML DOM / PDF






0

Style Sheets / PDF






Sample of the pdf document :  






HTML has evolved into a mixed-up language: it defines logical structure-defining elements like lists, headlines, etc. together with pure formatting directives like <font>, <b>, and <i>. It is advantageous to separate those two:

  • ·         want to define logical structures for our content
  • ·         want to separately define formatting options for the structures
  • ·         want to be able to apply one set of formatting rules to multiple web pages for uniformity

That’s what (X)HTML + CSS (Cascading Style Sheets) accomplishes. Style sheets define how a text structure should look like, whereas (X)HTML defines where the structures start and end and how they are related. Styles sheets are cascading, because you can attach more than one style sheet to one (X)HTML document and they will all cascade into one style.

Styles can be defined in three different ways

·         external: the styles are define in a separate file, usually with .css extension
·         internal: the styles are defined inside the HTML file, usually in the header section
·         inline: the style is defined inside an existing tag

The most useful one is an external style sheet, so we will stick with that for the most part.
Each style in a style sheet has three parts, a selector, one or more properties with one or more values each, following this syntax:
selector {
   property1: value1 [value2 ...];
   property2: value1 [value2 ...];
   ...
}

To attach a style sheet to an external XHTML document you use the <link> tag in an HTML file. To attach a style sheet called style.css you would add the following to the head section of an XHTML document:
<link href="style.css" rel="stylesheet" type="text/css" />

Here is the framework for an XHTML – CSS document pair (the CSS style sheet is called style.css):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Title goes here</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<p>Content goes here</p>
</body>
</html>

While you can create style sheets with any text editor, it is convenient to use a more powerful editor specializing in web page creation – for example Expression Web:

Exercise:

Use Expression Web to create a new HTML document as well as a new style sheet and save the empty files to the same directory. Make the HTML document your current one, then use the “Format” menu to attach your new style sheet to your web page. Create a level-1 headline, a list, and a paragraph of text in your web document.
Check the source of your document to verify that Expression Web has inserted the correct framework and attached the right style sheet.
Define the following style, save everything, switch to your HTML document and press F5 to reload:
h1 {
      border: 2px black solid;
}

More about style sheets:

Style sheets define three types of styles:
#id                          ID’s are frequently used to define large structures in an HTML document. Each id can be used only once in each HTML document
.class                     Classes are styles that can be reused and applied to different elements via a class parameter, such as <p class=”name”> … </p>. The class=”name” parameter can be added to any HTML element. Multiple classes can be applied to one element by separating them with spaces, as in <p class=”name1 name2”>
element               Elements are used to redefine how existing  HTML elements are to be formatted

Common style properties are fonts, alignment, borders, margins, paddings, and locations. Here is a list of some common CSS properties (taken from http://www.htmldog.com/guides/) but there are additional ones....







 Click here for  Download PDF / FREE
    

0

Attractions: HTML5 and XHTML5


 



 Sample of the pdf document :  






1. Introduction :

HTML is being revised to include more support for rich internet applications (RIA), mobile computing, and other recent developments.   The new revision will also include better support for sections, sidebars, etc.  The revision of HTML is being developed by the WHATWG or Web Hypertext Applications Technology Working Group. http://www.whatwg.org/   (Just to make life a little more complicated, HTML5 and XHTML5 will not include all the new features of XHTML2.0 – notably not the ability to created a link on any element.)

The new version will be called HTML5 and it may be ‘served’ or ‘serialized’ as either HTML (which, of course, is more forgiving) or as XHTML (more complex, but also has support for namespaces, MathML etc.)  These two ways are referred to as HTML5 and XHTML5

HTML5 may be used now (just include the <!doctype html> tag), but most browsers are not yet supporting all of it.  Some features (e.g. the canvas for bit maps) are supported, and HTML5 will become the standard when it is supported by at least two browsers.

The next sections of this document tell you what you need to know for HTML5 pages, for XHTML5 pages, and provide a list of references.  That list is valuable as this is a work-in-progress.   Until X/HTML5 is the standard I am continuing to write XHTML1.0 without the <?xml ….> processing instruction.


2. HTML5 documents

begin
              <!DOCTYPE html>
              <html lang=’en’>

You may write either <!DOCTYPE or <!doctype in the first tag, but (unlike HTML4.01) you must include a doctype.  This will also guarantee that your browser will use the most recent version of HTML.

Anything transmitted with the MIME type text/html will be rendered as HTML5.  The w3c recommends this for most authors as it will be compatible with older browsers. (see section 1.4.1 in http://www.w3.org/TR/html5/introduction.html ).

The lang attribute is optional and is specified in the html tag as lang=’en’.  (If not specified, it defaults to the lang value of the parent.)

The charset is specified as the FIRST element after <head>
                <meta charset =’utf-8’>



3. XHTML5 documents begin

     <html xmlns=’http://www.w3.org/199/xhtml’
                xml:lang=’en’>

Anything transmitted with MIME type application/xhtml+xml or application/xhtml or application/xml will be processed with an XML processor in the web – i.e. rendered as XHTML.  (see same reference.)

In HTML5, the DOM now is more than a way to manipulate the page (an API); each element in the DOM now has a meaning or semantics attached to it. 

The lang attribute ............









  Click here for  Download PDF / FREE
       

1

Learn HTML and CSS / PDF







Sample of the pdf document : 





Chapter 1. Setting Up Shop:

Before you dive in and start to build your web site, we need to take a little time to get your computer set up and ready for the work that lies ahead. That’s what this chapter is all about: ensuring that you have all the tools you need installed and are ready to go.

If you were to look at the hundreds of computing books for sale in your local bookstore, you could be forgiven for thinking that you’d need to invest in a lot of different programs to build a web site. However, the reality is that most of the tools you need are probably sitting there on your computer, tucked away somewhere you wouldn’t think to look for them. And if ever you don’t have the tool for the job, there’s almost certain to be one or more free programs available that can handle the task.

We’ve made the assumption that you already have an Internet connection, most likely broadband (or similar). Don’t worry if you have a slower connection: it won’t affect any of the tasks we’ll undertake in this book. It will, however, mean that some of the suggested downloads or uploads may take longer to complete, but you probably knew that already.

Note: Planning, Schmanning

At this point, it might be tempting to look at your motives for building a web site. Do you have a project plan? What objectives do you have for the site?

While you probably have some objectives, and some idea of how long you want to spend creating your site, we’re going to gloss over the nitty-gritty of project planning to some extent. This is not to say that project planning isn’t an important aspect to consider, but we’re going to assume that because you’ve picked up a book entitled Build Your Own Web Site The Right Way, you probably want to just get right into the building part.

As this is your first web site and it will be a fairly simple one, we can overlook some of the more detailed aspects of site planning.

Later, once you’ve learned—and moved beyond—the basics of building a site, you may feel ready to tackle a larger, more technically challenging site. When that time comes, proper planning will be a far more important aspect of the job. But now, let’s gear up to build our first, simple site...............




      Click here for  Download PDF / FREE
           

1

THE BEST TUTORIAL TO HTML AND CSS / PDF







Table of Contents:



Section I: HTML Basic

Chapter 1: HTML Getting Started

Chapter 2: HTML Fundamentals

Chapter 3: HTML Elements

Chapter 4: HTML Attributes

Chapter 6: HTML Paragraphs

Chapter 7: HTML Text Formatting

Chapter 8: HTML Styles

Chapter 9: HTML Links

Chapter 10: HTML Images

Chapter 11: HTML Tables

Chapter 12: HTML Lists

Chapter 13: HTML Forms & Input

Chapter 14: HTML Color

Chapter 15: HTML 4.01 Quick List


Section II: HTML/CSS Advanced:

Chapter 16: HTML Layout

Chapter 17: HTML Frames.

Chapter 18: HTML Fonts

Chapter 19: Why Use HTML 4.0?

Chapter 20: HTML CSS Styles.

Chapter 21: HTML Character Entities

Chapter 22: HTML Head & Meta Elements.

Chapter 23: HTML Uniform Resource Locators

Chapter 24: HTML Scripts

Chapter 25: HTML Standard Attributes.

Chapter 26: HTML Event Attributes

Chapter 27: HTML URL Encoding.

Chapter 28: Turn Your PC Into a Web Server

Chapter 29: HTML and CSS Summary

Section III: Appendixes








      Click here for  Download PDF / FREE




0

HTML URL Encoding Reference / PDF






                  

                Sample of the pdf document :  




URL - Uniform Resource Locator
Web browsers request pages from web servers by using a URL.
The URL is the address of a web page, like:  http://freetutorial-4u.blogspot.com.

URL Encoding
URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.

Try It Yourself
If you click the "Submit" button below, the browser will URL encode the input before it is sent to the server. A page at the server will display the received input.
Haut du formulaire

Bas du formulaire

Try some other input and click Submit again.

URL Encoding Functions
In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string.
In JavaScript you can use the encodeURI() function. PHP has the rawurlencode() function and ASP has the Server.URLEncode() function.
Click the "URL Encode" button to see how the JavaScript function encodes the text.
Haut du formulaire

Bas du formulaire

Note: The JavaScript function encodes space as %20.......





  Click here for  Download PDF / FREE
       

1

HTML Audio/Video DOM Reference / PDF






                       Sample of the pdf document :  






HTML Audio and Video DOM Reference
The HTML5 DOM has methods, properties, and events for the <audio> and <video> elements.
These methods, properties, and events allow you to manipulate <audio> and <video> elements using JavaScript.






HTML Audio/Video Methods
Method
Description
Adds a new text track to the audio/video
Checks if the browser can play the specified audio/video type
Re-loads the audio/video element
Starts playing the audio/video
Pauses the currently playing audio/video


HTML Audio/Video Properties
Property
Description
Returns an AudioTrackList object representing available audio tracks
Sets or returns if the audio/video should start playing as soon as it is loaded
Returns a TimeRanges object representing the buffered parts of the audio/video
Returns the MediaController object representing the current media controller of the audio/video
Sets or returns if the audio/video should display controls (like play/pause etc.)
crossOrigin
Sets or returns the CORS settings of the audio/video
Returns the URL of the current audio/video
Sets or returns the current playback position in the audio/video (in seconds)
Sets or returns if the audio/video is muted by default
Sets or returns the default speed of the audio/video playback
Returns the length of the current audio/video (in seconds)
Returns if the playback of the audio/video has ended or not
Returns a MediaError object representing the error state of the audio/video
Sets or returns if the audio/video should start over again when finished
Sets or returns a the group the audio/video belongs to (used to link multiple audio/video elements)
Sets or returns if the audio/video is muted or not
Returns the current network state of the audio/video
Sets or returns if the audio/video is paused or not
Sets or returns the speed of the audio/video playback
Returns a TimeRanges object representing the played parts of the audio/video
Sets or returns if the audio/video should be loaded when the page loads
Returns the current ready state of the audio/video
Returns a TimeRanges object representing the seekable parts of the audio/video
Returns if the user is currently seeking in the audio/video
Sets or returns the current source of the audio/video element
Returns a Date object representing the current time offset
Returns a TextTrackList object representing the available text tracks
Returns a VideoTrackList object representing the available video tracks
Sets or returns the volume of the audio/video










   Click here for  Download PDF / FREE
        

0

Tags