Wednesday, May 22, 2024

Goodies to Go! Newsletter #389

************************************************************

                     
Goodies to Go ™

              
May 16, 2006 — Newsletter # 389

 

     This newsletter is part of
the internet.com network.

                 
http://www.internet.com

 

          Please visit http://www.htmlgoodies.com

************************************************************

 

A Note about Email Filtering:
All Goodies To Go
newsletters are sent from the domain “internet.com.”  Please use this
domain name (not the entire “from” address, which varies) when configuring
e-mail or spam filter rules, if you use them.

 


Featured this week: a

 

*   Goodies Thoughts – A Little Web History
*   Q
& A Goodies
*   Discussion Goodies
*   News
Goodies
*   Feedback Goodies
*   Windows Tech Goodie
of the Week 
*   And Remember This…


A Little Web History


Have you ever wanted to provide a couple of buttons that would allow a
visitor to browse a little around the history of the web pages they visit in
your site?  If so, did you know how that could be done?  If not,
perhaps you’d be interested in taking a look at JavaScript’s history
object.


When you open your browser and surf through a few sites, the browser keeps
track of where you have been so that you can go back there by using either the
“back” button or other navigation techniques the browser may provide.  To
keep track, the browser builds a history file.  This file is just a series
of links to the URLs you have visited.  In the Internet Explorer (I’m
looking at version 6) you can view the contents of the history file either by
clicking the history button on the toolbar, by pressing ctrl-h, by selecting
View/Explorer Bar/History from the menu hierarchy or by clicking the little down
arrow to the right of the “Back” button.  Once you have the history
displayed, you can click on any link the revisit that page.


Wouldn’t it be nice if you could provide some access to your visitor’s
history from within your page?  With JavaScript, you can!  JavaScript
includes a “history” object.  You can use this object to replicate the
functions of the browser’s “Back” and “Forward” buttons.  Here’s an example
(see the note in the Q&A section below about code included in this
newsletter):


<.html><.head><./head><.body>
<.script
language=”javascript”><./script>
<.form
name=”form1″>
<.input type=”button”
name=”button1″
        value=”Go Back 2
Pages”
       
onclick=”window.history.go(-2);”/>   

<./form>
<./body><./html>


In this example, I have created a form which contains a single
button.  I have set the “onclick” event to use the “go()” method of the
“history” object to move back two pages.


The history object also includes “back()” and “forward()” methods to move
back and forward single pages.  Of course, before you could move forward,
you would have to have moved at least one page backwards.  The “go()’
method accepts a number parameter which can be either positive or negative and
moves you forward or backward (respectively) the specified number of 
pages, as shown in the above example.  You can use the history object’s
“length” property to find the length of the history list in the browser.


It’s easiest to think of uses for the back method, but with some thought
you could develop some interesting navigation techniques in your site by using a
combination of these methods.


There are also a couple of interesting tricks using the history
object.  If the index (the number parameter) of the “go()” method is set to
zero like this:
document.history.go(0);
then the current page would be
reloaded.  You could also set the index by using something typed in by the
user.  The following would use a text field they enter a value
into:
document.history.go(document.form1.text1.value);


If you want to do something like this you would have to be mindful of the
types of things a user could enter into the text box.  Some of them may not
be too useful for your go() instruction!  You could use a selection list to
limit the choices — as a programmer you always have to be on your toes!


Thanks for reading!


– Vince Barnes


************************************************************


Q & A Goodies
***********************************
Questions are
taken from submissions to our Community
Mentors. You can ask a Mentor a
question by going to
http://www.htmlgoodies.com/mentors/



XXXXXXXXXXXXXXXXXXXXXXXXXX

X                       
X
X   Please take note:    X

X                       
X
XXXXXXXXXXXXXXXXXXXXXXXXXX


We have had a number of people indicate that their email client programs
are interpreting code examples in this newsletter as actual HTML code instead of
text.  To overcome this problem and to enable everyone to read the
newsletter, there is a period after the “<” in each tag.  If you cut and
paste to try out code examples, please remember to remove the periods. 
Wherever we intend you to use “<.” in your code, the example will show
“<..”.  In this way, you will be safely able to use a global edit to
change “<.” to “<“.  Thanks to all of you for your patience with
this; if this technique creates an undue problem for you however, please let us
know via our feedback address (see Feedback, below).



*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers
    
Q. I would like to be able to create
clickable buttons at the top of my page to link to different places further down
the page.


A. Add this link code to your button image:
<.a
href=”#link1″><img src=”yourbuttonname.gif”><./a>
Then where
you want it to link to, add this anchor code:
<.a
name=”link1″><./a>
When you click the button it will jump down on
the same page to the anchor.


*** This question was submitted to our Mentor
Community.
     The answer was provided by one of our
Mentor Volunteers

 

Q. How do I move stuff where I want it on my website? I put the html in the
scripts area but when I go to my site everything is in the top left
corner.


A. By default, text and images will be placed at the top and to the left.
There are tags for positioning, and stylesheets give more control. Sometimes
tables are used for precise layout. I suspect tables would be the most useful
thing for you right now, so have a look at the tables tutorials. http://www.htmlgoodies.com/tutors/tbl.html



*** This question was submitted to our Mentor
Community.
     The answer was provided by one of our
Mentor Volunteers
    
    

Q. How do I make animated GIFs?.


A. Basically, you make each frame as a separate image, and your graphics
application combines them into one file. Imageready can do this. Shareware sites
may have Microsoft GIF Animator, which I’ve used and works adequately. There
will be other applications for animating GIFs. Probably shareware sites like
Nonags and Tucows are your best bet. If you’re willing to learn Flash or
Livemotion, they make animations which are smoother and smaller. 


*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers


Q. I would like to know the proper approach to run simultaneous javasrcipts
such as in the following scenario. I would like a “rain effect” script (called
from a .js file) over top my entire web page with underlying rotating images
scripts, sliding texts scripts, other animation scripts, etc. ie. items that
appear to be rained on. On top of the raining effect, I would to place other
javascripts (scripts within or outside of the page coding), animated gifs,
picutres, etc. that are “dry” i.e. …kind of a layering wet/dry senario.


A. When running multiple scripts on one page you need to insure that the
different scripts do not use the same variable and/or function names.  If
they do then you will have to change those that conflict.  If you need to
have multiple scripts start when the page loads the best way I have found is to
use
the onLoad event in the BODY tag to call both of them making sure you
separate them with a semicolon.
Like this:
<.BODY
onLoad=”function_one();function_two()”>



*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers


Q. Do you know of any commands that will not display the password as you
type it, or put in a series of asterisks, while still keeping the data so that
it can be compared to the values in a database?


A. HTML has a password form field that displays asterisks.
<.input
type=”password” name=”var name” size=”40″ maxlength=”80″ value=”default
value”>



Discussion Goodies
***********************************


Have you seen the discussion forums on the HTML Goodies website?  It’s
a great place to get help from others who, just like you, are developing web
pages.  Many different topics appear in the forum, and a new one will
appear if you create it!  Here’s a sample of recent topics:


Novice Needs Feedback on Site Implementation:
http://www.webdeveloper.com/forum/showthread.php?threadid=106161










News Goodies
***********************************


The Metrics on Blogs
[May 16, 2006] Top blogger Steve Rubel encourages
companies to engage the blogosphere but warns that hard metrics are still a work
in progress.  
Read the article:
http://www.internetnews.com/xSP/article.php/3606591



Creative Seeks Bite from Apple’s iPod
[May 16, 2006] Rival music
player maker wants iPod imports and sales stopped.
Read the article:
http://www.internetnews.com/bus-news/article.php/3606571



Wachovia SOA Married to The Process
[May 16, 2006] The senior vice
president described the bank’s objectives to a few hundred SOA enthusiasts in
New York.
Read the article:
http://www.internetnews.com/ent-news/article.php/3606556



BellSouth Denies NSA Involvement
[May 16, 2006] Telecom giant claims
it hasn’t turned over phone records in wake of more lawsuits.
Read the
article:
http://www.internetnews.com/infra/article.php/3606516



W3C Turns Up ‘Dial’ For Mobile Content
[May 16, 2006] DIAL is a new
language to help content creators write mobile software for myriad handheld
devices.
Read the article:
http://www.internetnews.com/dev-news/article.php/3606566



IBM Shatters Tape Density Mark
[May 16, 2006] Big Blue finds a way
to pack 6.67 billion bits per square inch.
Read the
article:
tp://www.internetnews.com/storage/article.php/3606316



Sun Releases Java EE 5, More Open Source Projects
[May 16, 2006]
Among the new open source code is interoperability between Java and Microsoft’s
.Net framework.
Read the article:
http://www.internetnews.com/dev-news/article.php/3606346



HP’s Networking ‘Single Pane of Glass’
[May 16, 2006] The company
extends ProCurve and adds control over wired and wireless system.
Read the
article:
http://www.internetnews.com/ent-news/article.php/3606531



High Court Bounces Buy It Now Injunction
[May 15, 2006] Justices
rule eBay may continue to offer service; orders new review of permanent
injunction sought by MercExchange.
Read the article:
http://www.internetnews.com/bus-news/article.php/3606301



New Firefox 2.0 Features Line Up For Release
[May 15, 2006] Firefox
is delving into features for its new version to keep the browser wars
going.
Read the article:
http://www.internetnews.com/dev-news/article.php/3606286



 
 
 
Feedback Goodies

***********************************


Did you ever wish your newsletter was an easy two way communications
medium?  Ploof! It now is!
If you would like to comment on the
newsletter or expand/improve on something you have seen in here, you can now
send your input to:




We already receive a lot of email every day.  This address helps us
sort out those relating specifically to this newsletter from all the rest. 
When you send email to this address it may wind up being included in this
section of the newsletter, to be shared with your fellow readers.  Please
don’t send your questions to this address.  They should be sent to our
mentors: see http://www.htmlgoodies.com/mentors/


Thanks for all your feedback!



Windows Tech Goodie of the Week 

***********************************


Visual Studio 2005 Hands-On Tutorial – Part 3


This is the third part in a series of hands-on tutorials that will take you
through all the steps to build a complete application using the new Visual
Studio 2005 and SQL Server 2005. This part will focus on building a Web
interface to the application.





*** AND ***



Dynamically Setting the Page’s Title in ASP.NET 2.0


Ths article, by Scott Mitchell, examines how to programmatically set the
title of an ASP.NET 2.0 web page; this article also looks at how to
automatically set the title based upon the page being visited in the site
map.





*** AND ***



Don’t Retrieve Data When Using Recordset.AddNew


If the only reason you’re creating a Recordset is to add new rows, then why
would you retrieve all the existing data first? It seems perfectly logical that
doing so is a waste of time, yet I see it done all the time.




And Remember This …
***********************************


On this day in…


1092 Lincoln Cathedral (England) was consecrated; 1671 Colonel Thomas Blood
attempted to steal the British Crown Jewels; 1899 the lawn mower was patented;
1901 Australia opened its first Parliament, in Melbourne; 1927 the Australian
Parliament first convened in its new capitol, Canberra; 1932 Picadilly Circus in
London was first lit by electricity; 1949 Prince Rainier III became leader of
Monaco; 1962 The Beatles signed their first contract, with EMI Parlophone; 1971
Friends of the Earth returned 1,500 non-returnable bottles to Schweppes; 1977
Patty Hearst was released from jail; 1980 35 motorists died when a Liberian
freighter rammed a bridge in Tampa Bay; 1995 Kinshasa, Zaire was quarantined
following an outbreak of the Ebola virus;


Born today were: in 1800 abolishionist who led the attack on Harpers Ferry,
John Brown; 1860 Scottish novelist Sir James Matthew Barrie (Peter Pan); 1873
English archeologist/Egyptologist Howard Carter (found Tutankhamen’s tomb);
English dog training expert Barbara Woodhouse; 1913 Admiral John Hayes; 1930
English actress Joan Sims; 1936 actor Albert Finney; 1936 English actress Glenda
Jackson; 1946 actress Candace Bergen; 1949 musician Billy Joel; 1962 actor John
Corbet;



*************************************************************

EarthWeb’s family of online services for IT insiders

*************************************************************
IT
MANAGEMENT http://www.earthweb.com/dlink.index-jhtml.72.949.-.0.jhtml

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured