Archive for January, 2008

Images and Graphics . 461 24-hour military time (Unlimited web hosting)

Thursday, January 31st, 2008

Images and Graphics . 461 24-hour military time notation to 12-hour notation. Pay attention, also, to the concatenation of a null string to force the conversion to a string, needed for the charAt() method. The returned value is converted backto integer format. getMinute(place) functiongetMinute(place) { varnow=newDate() varminute=now.getMinutes() if(minute<10) minute="0"+minute//donotparsenumber! minute+="" returnparseInt(minute.charAt(place)) } This function is similar to the getHour() function. See the listing for that function. getAmpm() functiongetAmpm() { varnow=newDate() varhour=now.getHours() if(hour>=12) return11//pm/*else*/ return10//am} The getAmpm() function returns 11 if the current time is P.M., and 10 if it is A.M. Notice that, since a return statement immediately terminates a function, the else keyword is not needed here and is commented out. getPath(url) functiongetPath(url) { lastSlash=url.lastIndexOf(”/”) returnurl.substring(0,lastSlash+1) } Chapter The script s last function, getPath(), extracts the full URL of the document s directory (or folder). It simply finds the last slash in the URL and returns the substring, starting at the beginning of the URL and ending at its last slash. Demonstration 2: LED Sign You have probably seen LED signs in airports and bulletin boards. This LED sign displays a given number of messages, one after the other, and returns to the first one
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

460 . Chapter 23 (Business web hosting) document.images[start + 5].src =

Thursday, January 31st, 2008

460 . Chapter 23 document.images[start + 5].src = digit[ampm].src } timerID = setTimeout(”setClock()”,1000) timerRunning = true } This function retrieves the current value of each digit (and symbol) in the clockand updates only the necessary images, i.e., only those digits that have been changed since the previous iteration. The blinking colon effect is accomplished by simply reversing the value of colon. Notice that the index of the images array is an offset from the last image of the document, not counting the clock s images. The variable timerID is now modified to recursively execute the function setClock(), after 1,000 milliseconds. update() function update() { stopClock() setClock() } The function update() stops the clockand then restarts it. stopClock() function stopClock() { if (timerRunning) clearTimeout(timerID) timerRunning = false } This function clears the timeout and sets the timerRunning variable to false, indicating that the timer is not running because no timeout is set. getHour(place) function getHour(place) { var now = new Date() var hour = now.getHours() if (hour >= 12) hour = 12 hour = (hour == 0) ? 12 : hour if (hour < 10) hour = "0" + hour // do not parse number! hour += "" return parseInt(hour.charAt(place)) } The getHour() function has been mentioned a lot before. It finds the digit in place position of a two-digit hour representation. Notice the computation to convert a
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Web hosting service - Images and Graphics . 459 varcloseImage=”.gif”HEIGHT=21WIDTH=16>” document.write(openImage+hour1+closeImage) document.write(openImage+hour2+closeImage)

Wednesday, January 30th, 2008

Images and Graphics . 459 varcloseImage=”.gif”HEIGHT=21WIDTH=16>” document.write(openImage+hour1+closeImage) document.write(openImage+hour2+closeImage) document.write(openImage+”c.gif”HEIGHT=21WIDTH=9>”) document.write(openImage+minute1+closeImage) document.write(openImage+minute2+closeImage) document.write(openImage+((ampm==10)?”am”:”pm”)+closeImage) The timerID variable, which holds the elapsed time before the next clockupdating, is initialized to null before the clockstarts running. For the same reason, the timerRunning variable is set to false. The function update() starts the infinite loop of running the clock: vartimerID=nullvartimerRunning=falseupdate() setClock() function setClock() { if (getHour(0) != hour1) { // not getHours()! hour1 = getHour(0) document.images[start].src = digit[hour1].src } if (getHour(1) != hour2) { // not getHours()! hour2 = getHour(1) document.images[start + 1].src = digit[hour2].src } colon = !colon if (!colon) document.images[start + 2].src = digit[13].src else 23 document.images[start + 2].src = digit[12].src if (getMinute(0) != minute1) { // not getMinutes()! minute1 = getMinute(0) document.images[start + 3].src = digit[minute1].src } if (getMinute(1) != minute2) { // not getMinutes()! minute2 = getMinute(1) document.images[start + 4].src = digit[minute2].src } if (getAmpm() != ampm) { ampm = getAmpm() Chapter
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

458 . Chapter 23 digit[2] = new Image(16, (Domain and web hosting)

Wednesday, January 30th, 2008

458 . Chapter 23 digit[2] = new Image(16, 21) digit[3] = new Image(16, 21) digit[4] = new Image(16, 21) digit[5] = new Image(16, 21) digit[6] = new Image(16, 21) digit[7] = new Image(16, 21) digit[8] = new Image(16, 21) digit[9] = new Image(16, 21) digit[10] = new Image(16, 21) // am digit[11] = new Image(16, 21) // pm digit[12] = new Image(9, 21) // colon digit[13] = new Image(9, 21) // blank Since the artistic representation of each symbol is given in a gif format, we assign a gif filename to the src property of each element of the digit array. The gif files are located in the same directory as the URL, and the naming algorithm is based on concatenating the dg substring to the characters represented by the image (0-9, am, pm). The colon symbol is denoted by a c character, and the blankby a b. // assign sources to digit image objects (0 -9) for (vari=0;i<10; ++i) { digit[i].src = getPath(location.href) + "dg" + i + ".gif" } // assign sources to other image objects digit[10].src = getPath(location.href) + "dgam.gif" digit[11].src = getPath(location.href) + "dgpm.gif" digit[12].src = getPath(location.href) + "dgc.gif" digit[13].src = getPath(location.href) + "dgb.gif" Then, we find the current time and store it in six variables, four digits for the hour and minute, one for the ampm value, and one Boolean variable for the blinking colon. After initializing the time variables, the script turns off the colon, which is then ready to be turned on next time: // set initial time values to current time var hour1 = getHour(0) var hour2 = getHour(1) var minute1 = getMinute(0) var minute2 = getMinute(1) var ampm = getAmpm() var colon = false We need to probe and remember the number of images already displayed in the document: // get array substring of first clock image in document.images array var start = document.images.length// number of images in document When the page is loaded, the script displays the clock. Since JavaScript does not support image creation, all images are constructed via HTML: // print initial clock var openImage = "From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Images and Graphics . 457 functiongetHour(place) { varnow=newDate() (Web site builder)

Tuesday, January 29th, 2008

Images and Graphics . 457 functiongetHour(place) { varnow=newDate() varhour=now.getHours() if(hour>=12) hour =12hour=(hour==0)?12:hourif(hour<10) hour="0"+hour//donotparsenumber! hour+="" returnparseInt(hour.charAt(place)) } functiongetMinute(place) { varnow=newDate() varminute=now.getMinutes() if(minute<10) minute="0"+minute//donotparsenumber! minute+="" returnparseInt(minute.charAt(place)) } functiongetAmpm() { varnow=newDate() varhour=now.getHours() if(hour>=12) return11//pm/*else*/ return10//am} functiongetPath(url) { lastSlash=url.lastIndexOf(”/”) returnurl.substring(0,lastSlash+1) } //–> Example 23-6. An updating clock. Global Statements The script starts by creating the digit array, holding 14 instances of the Image object, for the digits 0 through 9, am, pm, colon, and blanksymbols. All images are 21 pixels high and 16 pixels wide, except for the colon and the blankimages which are thinner (9 pixels): // create array of all digit images var digit = new Array() digit[0] = new Image(16, 21) digit[1] = new Image(16, 21) Chapter
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Web site translator - 456 . Chapter 23 var timerRunning = false

Tuesday, January 29th, 2008

456 . Chapter 23 var timerRunning = false update() function setClock() { if (getHour(0) != hour1) { // not getHours()! hour1 = getHour(0) document.images[start].src = digit[hour1].src } if (getHour(1) != hour2) { // not getHours()! hour2 = getHour(1) document.images[start + 1].src = digit[hour2].src } colon = !colon if (!colon) document.images[start + 2].src = digit[13].src else document.images[start + 2].src = digit[12].src if (getMinute(0) != minute1) { // not getMinutes()! minute1 = getMinute(0) document.images[start + 3].src = digit[minute1].src } if (getMinute(1) != minute2) { // not getMinutes()! minute2 = getMinute(1) document.images[start + 4].src = digit[minute2].src } if (getAmpm() != ampm) { ampm = getAmpm() document.images[start + 5].src = digit[ampm].src } timerID = setTimeout(”setClock()”,1000) timerRunning = true } function update() { stopClock() setClock() } function stopClock() { if (timerRunning) clearTimeout(timerID) timerRunning = false }
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Images and Graphics . 455 JavaScript clock ” (Web hosting billing)

Monday, January 28th, 2008

Images and Graphics . 455 JavaScript clock onLoad The onLoad event handler is triggered when an image is displayed. Do not confuse displaying an image with loading one. You can load several images and then, by setting the instance s src property, you can display them one by one in the same Image object instance. If you change a displayed image this way, the onLoad event handler executes every time an image is displayed, not only when the image is loaded into memory. If you specify an onLoad event handler for an Image object that displays a looping gif animation (multi-image gif), each loop of the animation triggers the onLoad event, and the event handler executes once for each loop. By repeatedly setting the src property of an image s JavaScript reflection, you can use the onLoad event handler to create a JavaScript animation. Demonstration 1: Updating Digital Clock The following JavaScript script displays a digital clockon your page that is updated every minute. The clockincludes two digits for the hour, a delimiting colon, two digits for the minute, and am/pm subscript: <br />Check <a href="http://domain.tomcatjavahosting.com">Tomcat Web Hosting</a> services for best quality webspace to host your web application. </p> </div> <p class="postmetadata">Posted in <a href="http://jboss.smartwebsitehosting.net/category/jboss/" title="View all posts in JBOSS" rel="category tag">JBOSS</a> | <a href="http://jboss.smartwebsitehosting.net/jboss/454-chapter-23-onerror-simple-web-server-an-error-event/#respond" title="Comment on 454 . Chapter 23 onError (Simple web server) An error event">No Comments »</a></p> </div> <div class="post"> <h3 id="post-513"><a href="http://jboss.smartwebsitehosting.net/jboss/images-and-graphics-453-width-width-is-web-design-company/" rel="bookmark" title="Permanent Link to Images and Graphics . 453 width width is (Web design company)">Images and Graphics . 453 width width is (Web design company)</a></h3> <small>Sunday, January 27th, 2008</small> <div class="entry"> <p>Images and Graphics . 453 width width is a string specifying the width of an image either in pixels or as a percentage of the window width. The general syntax is as follows: imageName.width imageName is either the name of an Image object s instance or an element in the document.images array. The width property reflects the WIDTH attribute of the <IMG> tag. For images created with the Image() constructor, the value of the width property is the actual, not the displayed, width of the image. The width property is read-only. The script in Example 23-3 shows how an alert box can display, upon clicking a button, the height, width, and space around an image. Event Handlers onAbort An abort event occurs when the user aborts the loading of an image (for example, by clicking a link or the Stop button). The onAbort event handler executes JavaScript code when an abort event occurs. In Example 23-5, an onAbort handler belonging to an Image object displays a message when the user aborts the image s loading: <HTML> <HEAD> <TITLE>Aircrafts Chooseanimage:
IMAGE1
IMAGE2
IMAGE3

Example23-5.ThescriptfromExample23-4withtheonAborteventhandler. Chapter
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Web design templates - 452 . Chapter 23 Example 23-4. A script

Sunday, January 27th, 2008

452 . Chapter 23 Example 23-4. A script to display one of three images; low-resolution images are loaded first. name The name property reflects the NAME attribute of the HTML definition. The name property is read-only. Similar to forms, you can use an image s name to reference it. If the first image in a document is defined by the following syntax, for instance, you can reference it as document.myImage as well as document.images[0]: src src specifies the URL of an image to be displayed in a document. The general syntax is: imageName.src imageName is either the name of an Image object s instance or an element in the document.images array. The src property is used in almost all of this chapter s examples. Consider the following statement: var myImage = new Image() An instance of the Image object, named myImage, is created with the Image() constructor. When you create an instance of the Image object in this fashion, it is not associated with any image. In order to associate it with an existing image you must assign a value to its src property, in the following manner: myImage.src = “myPicture.gif” You can use either a full or relational URL. When you associate an image with an instance in this fashion, the image is cached. Since it is already stored on the client side (where the cache normally is), the user does not have to wait for the image to be received from the server when you decide to display the image. When you adjust the src property of an element from the document.images array (or an image that is viewable on the page), the image immediately changes to the image at the new URL. vspace This property is a string specifying the margin in pixels between the top and bottom edges of an image and the surrounding text. The general syntax is as follows: imageName.vspace imageName is either the name of an Image object s instance or an element in the document.images array. The vspace property reflects the VSPACE attribute of the tag. For images created with the Image() constructor, the value of the vspace property is 0. The vspace property is read-only. The script in Example 23-3 shows how an alert box can display, upon clicking a button, the height, width, and space around an image.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.