• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

pop up window to display an array object using Tomcat

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My problem looks like a javascript problem, but
it is more seen when using Tomcat as the web server.
I have a file (test.jsp) listing a list of items. When I click any of them, a popup window
will display the corresponding data. The data are stored in two arrays (array1 and array2).
But when I switch between the links, sometimes, the popup window does display the
corresponding data, but sometimes displays nothing, Any clues?
If I change the code to remove blank.htm page (example: window.open('','TheRemote'....) ),
the output is appended to the end of the string.
Thanks for help!
<head><title>JSP Page</title>
<script language="JavaScript" type="text/JavaScript">
var array1 = new Array( );
array1[0] = "Item1a";
array1[1] = "Item1b";
var array2 = new Array ();
array2[0] = "Item2a";
array2[1] = "Item2b";
function displayArray (x) {
var remote = window.open('blank.htm','TheRemote',"height=250,width=250,status=yes,toolbar=no,menubar=yes,location=no,resizable=yes,scrollbars=yes");
var output = "";
for (var i=0; i<x.length; i++) {
output += x[i] + ';';
output = "<html><head><title>test</title></head><body>" + output + "</body></html>";

<A HREF="javascript isplayArray(array1);" >Item One</a><BR>
<A HREF="javascript isplayArray(array2);">Item Two</a><BR>
blank.htm (located in the same directory as test.htm)
    Bookmark Topic Watch Topic
  • New Topic