Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I want to call my javaScript function with a parameter value that is determined dynamically. When I call my showWine function from my <a> tag I get an undefined variable error. What is the best way to code this simple functionality? I have reduced my jsp code to illustrate my problem.
[ September 26, 2002: Message edited by: Rich Smyth ]
Thanks James it worked. I applied your idea to the code on which my simple example was based and also got that to work. But i'm not sure if I did it correctly. I ultimately want to use the parameter of my showWine function as a parameter for a jsp. I had to build the url that uses this parameter in a separate statement, outside the open.window call. Is there a way to use just a single statement? I tried variations of ".../aboutTheFeaturedWine.jsp?promo=<%= feature %>" but that didn't work The version of my function that works but is perhaps not elegant: <SCRIPT LANGUAGE="JavaScript"> function showWine(feature) { featurePage = "http://localhost:8080/WineProject/aboutTheFeaturedWine.jsp?promo=" + feature var porps = window.open(featurePage, "windowFeaturedWine", "toolbars=1, scrollbars=1, menubars=0, resizable=1, width=400, height= 200"); } </SCRIPT>
Good heavens! What have you done! Here, try to fix it with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth