[thelist] Little piece of Javascript code

Matt Warden mwarden at gmail.com
Fri Jan 7 12:37:50 CST 2005


Maisha,

On Fri, 07 Jan 2005 11:32:04 -0500, Maisha Walker <maisha at e-vent.org> wrote:
> I have a calendar which shows the details of each event in a pop-up window.
> When people click on a link (either from the site or from an email) for a
> particular event, I'd like both the calendar and the detail page for that
> event to open up so that the user doesn't have to click twice.
> 
> But there will also be times when someone will just click on the calendar
> link so no event detail window will open.

You will basically need two components.

1. URL querystring parsing, that will extract the information you need
from the URL (if it exists):
http://www.google.com/search?q=javascript+%7Eparse+querystring+-perl

2. The pop-up window code. This is actually very trivial, but the
exact URL you use will depend on the server-side code of your
calendar. It will probably look something like this:
window.open('/calendar/event?eventid='+ id, ...);

where 'id' is a javascript variable holding the event id that you just
extracted from the URL in #1, and '...' are the other options in
window.open. See:

http://www.google.com/search?q=javascript+%22window.open%22
Specifically, one of the results is a window.open code wizard. So,
that might be of particular help to you:
http://www.wizardscc.com/wizards/newwindow.asp

Good luck,


-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list