Pukeko wrote:
> Hi, this is an array that is used for a dropdown menu.
From your question below I surmise you are probably talking about a
`select'
element that only works with present and enabled client-side script
sup****t,
which would be a really bad idea.
> var imageArray = new Array(
> "ecwp://" + do***ent.location.host + "/massey/images/massey/
> massey_07_fullres.ecw",
do***ent.location has been deprecated more than 10 years ago.
> "ecwp://" + do***ent.location.host + "/sampleiws/images/usa/
> 1metercalif.ecw",
> "ecwp://" + do***ent.location.host + "/sampleiws/images/australia/
> parramatta.ecw";
Your source code is syntactically incorrect: the closing `)' for the
constructor call is missing. That aside, I would do at least:
var imageArray = new Array(
new Array("ecwp://", "/massey/images/massey/massey_07_fullres.ecw"),
new Array("ecwp://", "/sampleiws/images/usa/1metercalif.ecw"),
new Array("ecwp://", "/sampleiws/images/australia/parramatta.ecw")
);
for (var i = 0, len = imageArray.length; i < len; i++)
{
imageArray[i] = imageArray[i].join(do***ent.location.host);
}
> when the menu is displayed it shows the whole value
>
> "ecwp://" + do***ent.location.host + "/massey/images/massey/
> massey_07_fullres.ecw""
>
> is there a way i can just display a name for the image in the dropdown
> menu, like "Massey 2007"
Yes, there is, for example by using your own constructor:
/**
* Constructs a new <code>Item</code> object.
*
* @[EMAIL PROTECTED]
uriParts: Array
* 2-element array containing the scheme and the path of
* the target URI. The parts are joined with the host name
* of the URL of the current do***ent.
* @[EMAIL PROTECTED]
text: optional string
* Text for the menu item; the default is the target URI.
* @[EMAIL PROTECTED]
*/
function Item(uriParts, text)
{
/**
* URI of the target resource
*/
this.uri = uriParts.join(window.location.host);
/**
* Text for the menu item
*/
this.text = text || this.uri;
}
var imageArray = new Array(
new Item(
new Array("ecwp://", "/massey/images/massey/massey_07_fullres.ecw"),
"Massey 2007"
),
...
);
You should then get informed how HTML `select' and `option' elements work,
or RTFM of your "menu" script of which you have not even posted the
relevant
parts here.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann


|