[Javascript] thumbnails displayed on one html page

Peter Brunone peter at brunone.com
Fri Dec 7 23:55:09 CST 2001


Dave,

	In server-speak, the parameters after the ? in the URL are called the
querystring.  In the client side world... well, I don't know what to call
them, so we'll just keep calling them that :-)

	Using the window.location.href property, you can get the entire URL of the
current page (including parameters that you append).  The correct syntax for
appending parameters is as follows:

http://www.domain.com/directory/file.html?param1=this&param2=that

and so on.  When you grab this entire string using window.location.href, you
can then parse the URL for the pieces you want using the .substring and
.indexOf methods and the .length property of your string.  For example, if
you wanted the piece of the above URL (after putting it into a variable
called strURL) after the question mark, you would do the following:

strParams = strURL.substring(strURL.indexOf("?"), strURL.length);

	You could then split up the pieces further.  I suggest you pick one of the
Javascript resources from
http://www.mountaindragon.com/javascript/resources.htm or a good book and
read up on the string methods.

	Alternatively, you could do this server-side with PHP, ASP, PERL, or
another scripting environment.  For what it's worth, I find server-side
methods easier and more powerful for dynamic content like this, but what you
want is still attainable with client-side Javascript.

Cheers,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Dave
|Sent: Friday, December 07, 2001 8:21 PM
|To: javascript at LaTech.edu
|Subject: [Javascript] thumbnails displayed on one html page
|
|
|Hi,
|    I am not an expert so I have come to find help on an operation I
|have seen work, but cannot get it to work for me. I want to display
|pictures created with thumbnails with the output going to a single html
|page so I can retain my background to match my website. This is opposed
|to the full sized image being displayed on a white background and in the
|upper left hand corner. I have heard of a "?" extension (in html 4.01)
|being applied to an html document in the URL address with everything
|being set after a "?" in a document, accessable from javascript in the
|opened document. You can then use it to send the filename of the image
|to be opened on that page. Does anybody know how to do that?
|Thanks,
|Dave
|
|_______________________________________________
|Javascript mailing list
|Javascript at LaTech.edu
|https://lists.LaTech.edu/mailman/listinfo/javascript
|




More information about the Javascript mailing list