Does anyone know how to make a popup window point to a dynamic URL? I am trying to adapt some code the was given to me to do this. The overall function of the code searches the html of a given page for an ISBN number and then takes that information and builds a URL that links to information on the book at Google Book Preview.

I've pasted a portion of the code below and attached a .txt file of the code in its entirety.

In its current state when I attempt to click on the link created by the code nothing happens. I can see that the URL the link is trying to call is "javascriptpenNewWindow()". Some how the dynamic URL is not making its way in there. Any help would be greatly appreciated.

if (bookInfo.preview == "full" || bookInfo.preview == "partial") {
preview = "<a href='javascriptpenNewWindow()'>Preview this item</a>";

function openNewWindow() {
var popupWin = window.open(bookInfo.preview_url,
'open_window',
'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0');