The question title may be more revealing, but let me describe my aim better, which is to generate variable content. In particular, I want a single template to serve as popup captions for different images on my site.
I am hoping to find a substitute for what I used to have. Clicking on images displayed a popup caption. Mouseover (thanks to alt and title attributes) still does, and I didn't want to build tables around each image with ordinary captions. You can still see this with much of my Web site, as on this page: http://www.haberarts.com/themes14.htm. Click on the image, and you'll see. However, my home page is a blog in WordPress rather than static html, which does not allow this.
But the idea is that the function has three variables, for image artist, title, and source/date. So my onclick would be set equal to popcap(), with the parenthesis containing in single quotes the three variables (sometimes with a | in case one was too long to fit on one line).