Archive for November, 2007

Web server hosting - 334 . Chapter 19 B Fontdocument.write, also accessible

Friday, November 30th, 2007

334 . Chapter 19 B Fontdocument.write, also accessible as window.document.write, can be used from either a plain script () or from an event handler. Bear in mind that event handler scripts are executed only after the HTML source has been through layout. The write() method implicitly opens a new document of mimeType text/html if you do not explicitly invoke a document.open() method prior to the document.write() call. The writeln() method acts exactly like the write() method, except that it appends a new line character to the end of the output. HTML generally ignores this character, but certain tags, such as

, use it:   
 one two three 
After interpretation, the web page appears as: one two three You can create the same output via JavaScript in the following fashion: document.write(”
“) document.writeln(”one”) document.writeln(”two”) document.writeln(”three”) document.write(”
“) Data Streams The document.open() method opens a stream to collect the output of write() and writeln() methods. Its general syntax is: document.open([”mimeType”]) mimeType specifies the type of document, which is one of the following: text/html text/plain image/gif image/jpeg image/x-bitmap plugIn plugIn is any two-part plug-in supported by the user s browser. Generally speaking, if mimeType is text or image, the stream is opened to layout, which is generated by instructions from the browser. Otherwise, the stream is opened to a target plug-in which you have to make sure understands the data you provide.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

The document Object Colors, Output, and Properties . 333 (Web proxy server)

Friday, November 30th, 2007

The document Object Colors, Output, and Properties . 333 fgColor The document.fgColor property represents the color of the document text (foreground color). It reflects the tag s TEXT attribute. The property is expressed as a hexadecimal RGB triplet or as one of the supported color names. When you assign it a triplet, the crosshatch mark (#) is optional. Setting a value to the fgColor property is equivalent to setting a value to the tag s TEXT attribute, enclosing the entire text with the tag pair, or using the String object s fontcolor method. alinkColor The document.alinkColor property is JavaScript s reflection of the tag s ALINK attribute. It is a string specifying the color of an active link (after the mouse button is pressed down over a link but before it goes back up). The string must represent the hexadecimal RGB triplet of a color or one of the supported color names. Aside from a few exceptions, you cannot set the value of this property after the page has finished loading, because there is no way to modify a page s content after it has been laid out. linkColor The document.linkColor property is JavaScript s reflection of the tag s LINK attribute. It specifies the color of the document s hypertext links which the user has not visited yet. The color must be represented in the form of a hexadecimal RGB triplet or one of the supported color names. As explained above, you cannot set this property after the HTML source has gone through the layout stage. You can still read the property s value at any time via an immediate script or a deferred one. vlinkColor The document.vlinkColor property is JavaScript s reflection of the tag s VLINK attribute. The color must be represented in the form of a hexadecimal RGB triplet or one of the supported color names. This property represents the color of already-followed hypertext links. You can set it as long as the HTML source has not been through layout yet. Output Methods and Streams write and writeln The document.write method displays any number of expressions in a document window. Expressions to be printed can be of any type, including numerics, strings, and logicals. This method prints its arguments to the plain HTML document window. It does not append any external character to the printed arguments. The method Chapter
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

Starting a web site - 332 . Chapter 19 setbgColor(red, green, blue) //

Friday, November 30th, 2007

332 . Chapter 19 setbgColor(red, green, blue) // set background color to specified descriptors function setbgColor(red, green, blue) { document.bgColor = “#” + toHex(red) + toHex(green) + toHex(blue) } This function accepts three RGB descriptors and assigns the color combination to the document.bgColor property, setting the document s background color. The arguments are in decimal notation, so first they are converted to hex numbers. fade(sred, sgreen, sblue, ered, egreen, eblue, step) // fade from start to end descriptors (increase step to increase transition speed) function fade(sred, sgreen, sblue, ered, egreen, eblue, step) { // loop to create fade effect for(vari=0;i<= step; ++i) { // set current red descriptor var red = Math.floor(sred * ((step i) / step) + ered * (i / step)) // set current green descriptor var green = Math.floor(sgreen * ((step i) / step) + egreen * (i / step)) // set current green descriptor var blue = Math.floor(sblue * ((step i) / step) + eblue * (i / step)) // set background color according to descriptors setbgColor(red, green, blue) } } This function is responsible for the fade effect. It accepts seven arguments; the first three represent the RGB descriptors of the initial background color, the next three represent the RGB values of the target one, and the last argument determines the speed of the fade. The function consists of a single loop which iterates from 0 to step in increments of one. The RGB descriptors of the current background are computed and assigned to local variables on each iteration of the loop. A computed red, green, or blue color is a weighted average between the initial color value and the target one. During the first iteration, step i is equal to step, so the initial color descriptor is actually multiplied by 1 in the expression Math.floor(scol * ((step i) / step). Since i is 0, the descriptor of the target color is multiplied by 0 in the expression ecol * (i / step) where col is red, green,or blue. Therefore, the background color is set to the initial color during the first pass and to the target color during the last pass. The last statement in the loop actually sets the background color by passing the computed descriptors to setbgColor(). Event Handlers It is common to use the fading effect with the onLoad and onUnload event handlers. If you prefer to use it with both, it is recommended that you generate the reversed transition for each.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

The document Object Colors, Output, and Properties . 331 (Web design careers)

Thursday, November 29th, 2007

The document Object Colors, Output, and Properties . 331 // set background color according to descriptors setbgColor(red, green, blue) } } // –>

Is this totally cool or what!!

Example 19-2 (ex19-2.htm). A script to create a fade effect. The script gradually changes the document s background color from a given color to another specified color. It works with any colors represented in a hexadecimal triplet format. Let s analyze the script. toHex(dec) // convert decimal value (0 -255) to hexadecimal // (use .toString(16) method supported by IE) function toHex(dec) { // create list of hex characters var hexCharacters = “0123456789ABCDEF” // if number is out of range return limit if (dec < 0) return "00" if (dec > 255) return “FF” // decimal equivalent of first hex character in converted number var i = Math.floor(dec / 16) // decimal equivalent of second hex character in converted number varj=dec%16 // return hexadecimal equivalent return hexCharacters.charAt(i) + hexCharacters.charAt(j) } This function accepts a single argument representing a decimal number, normally between 0 and 255. It converts it to its hexadecimal equivalent. At first, a list of the hexadecimal digits is assigned to the string variable hexCharacters. It returns the minimum 00 string if the decimal argument is less then 0, and the maximum FF if the decimal argument is greater than 255, the equivalent to FF in hex representation. The value Math.floor(dec / 16) is equal to the decimal representation of the first hexadecimal digit in the converted number. The value Math.floor(dec % 16) is equal to the decimal value of the second hex digit of the converted number. The hexadecimal value of a decimal number from 0 to 15 is that hexCharacter s character, the index of which is equal to the decimal number. Chapter
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Web hosting uk - 330 . Chapter 19 // close table row

Thursday, November 29th, 2007

330 . Chapter 19 // close table row and table document.write(’‘) } Unlike other functions, this one does not accept any arguments. It creates the outline table of a single six-cell row with a white background color. The function calls drawTable() six times, once for each given blue descriptor. Setting the CELLPADDING attribute to a positive number separates the tables. Another classic example that takes advantage of the ability to set background colors via JavaScript is a script that creates a fade-in or fade-out effect when the page is loaded or unloaded. Here is the script: Fade in and out Example 19-1 (ex19-1.htm). A color cube. This script basically prints tables. Each table cell contains a transparent image which defines the size of the cell. Each cell is also assigned a background color which determines the color that fills that cell. When you click on the image, the hexadecimal triplet is displayed via an alert box, and the background color is set to the selected color. The main outline of the cube is a table with one row and six cells (columns). Each cell contains a table of all non-dithered colors with a given blue descriptor. There are six tables in total, one for each of the non-dithered colors: 00, 33, 66, 99, CC, FF. Since there are six non-dithered hexadecimal values, each table is6×6. Each row presents a red hexadecimal value and each column represents a green one. The final output can be viewed in the following screen: Chapter Figure 19-2. Output from Example 19-1. Now let s analyze the script itself. Global Statements // create 6-element array var hex = new Array(6) // assign non-dithered descriptors hex[0] = “FF” hex[1] = “CC” hex[2] = “99″ hex[3] = “66″
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Virtual web hosting - 326 . Chapter 19 document.write('’) // close link

Tuesday, November 27th, 2007

326 . Chapter 19 document.write(’‘) // close link tag document.write(’‘) // close table cell document.write(’‘) } // draw table row based on red and blue descriptors function drawRow(red, blue) { // open table row document.write(’‘) // loop through all non-dithered color descripters as green hex for (vari=0;i<6; ++i) { drawCell(red, hex[i], blue) } // close current table row document.write('‘) } // draw table for one of six color cube panels function drawTable(blue) { // open table (one of six cube panels) document.write(’

‘) // loop through all non-dithered color descripters as red hex for (vari=0;i<6; ++i) { drawRow(hex[i], blue) } // close current table document.write('
‘) } // draw all cube panels inside table cells function drawCube() { // open table document.write(’‘) // loop through all non-dithered color descripters as blue hex for (vari=0;i<6; ++i) { // open table cell with white background color document.write('‘) } // close table row and table document.write(’
‘) // call function to create cube panel with hex[i] blue hex drawTable(hex[i]) // close current table cell document.write(’
‘) } // call function to begin execution drawCube()
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

The document Object Colors, Output, and Properties . 325 (X web hosting)

Monday, November 26th, 2007

The document Object Colors, Output, and Properties . 325 [LINK=”#unfollowedLinkColor”] [ALINK=”#activatedLinkColor”] [VLINK=”#followedLinkColor”]> All color attributes are scripted via JavaScript as properties of the document object. bgColor The document.bgColor property is expressed as a hexadecimal RGB triplet or as a string literal such as blue. This property is the JavaScript reflection of the BGCOLOR attribute of the tag. You can change the background color at any time, even via a deferred script. If you express the color as a hexadecimal RGB triplet, you must use the format rrggbb (case insensitive). The bgColor property is a commonly scripted property. You can set it to create fade effects, color cubes, and so forth, as will be demonstrated in this chapter. The following script creates a sample color cube and sets the background color to the one the user selected from the cube: Sample Color Cube