This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes pop up window to display an array object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "pop up window to display an array object" Watch "pop up window to display an array object" New topic

pop up window to display an array object

Elizabeth Chen

Joined: Aug 09, 2001
Posts: 7
I have a file (test.htm) 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:'','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 ='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)
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 567
Try calling document.close() on remote after you've done a write.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
I agree. Here's the link:
subject: pop up window to display an array object