function parameter question

M

Michael Hansen

how do avoid this:

function iframe01Location(newLocation)
{
(iframe01.location=newLocation);
}

function iframe02Location(newLocation)
{
(iframe02.location=newLocation);
}

i want to do something like this (this don´t work):

function iframeLocation(iframeName, newLocation)
{
(iframeName.location=newLocation);
}


Michael.
 
S

Stephen

Michael said:
how do avoid this:

function iframe01Location(newLocation)
{
(iframe01.location=newLocation);
}

function iframe02Location(newLocation)
{
(iframe02.location=newLocation);
}

i want to do something like this (this don´t work):

function iframeLocation(iframeName, newLocation)
{
(iframeName.location=newLocation);
}


Michael.
maybe:

window.frames[iframeName].location=newLocation;

?

Stephen
 
M

Michael Hansen

yup thanks!

function iframeLocation(iframeName, newLocation)
{
(window.frames[iframeName].location=newLocation);
}

works perfect :)

/M



Stephen said:
Michael said:
how do avoid this:

function iframe01Location(newLocation)
{
(iframe01.location=newLocation);
}

function iframe02Location(newLocation)
{
(iframe02.location=newLocation);
}

i want to do something like this (this don´t work):

function iframeLocation(iframeName, newLocation)
{
(iframeName.location=newLocation);
}


Michael.
maybe:

window.frames[iframeName].location=newLocation;

?

Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,101
Messages
2,570,637
Members
47,243
Latest member
RustyPalin

Latest Threads

Top