Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
maguskrool #1
function with variable number of arguments
Hi.
I've defined the following function to open a variable number of popups:
function openPopups (aNames)
{
for (var i=1; i <= arguments.length-1; i++) {
arguments[0].push (window.open (arguments[i].sUrl, ' ', 'left=' +
arguments[i].nLeft + ',top=' + arguments[i].nTop + ',width=' +
arguments[i].nWidth + ',height=' + arguments[i].nHeight + ', ' +
arguments[i].sResizable +', ' + arguments[i].sScrollbars + ', ' +
arguments[i].sToolbar));
}
}
The function receives a variable number of arguments, the first of which is an
array (aNames) where the popup windows' names will be stored. The remaining are
objects with all the properties shown in the function window.open: sUrl, nLeft,
nTop, nWidth, nHeight, sResizable, sScrollbars, sToolbar. However, I'd like to
define the objects with only the relevant properties, since many of them won't
need several properties. This doesn't seem to work, and so far I've had to
define every property for every object. Is there anyway I can change the
function so it works and ignores the properties that are not defined? Or is the
problem with the objects? I have defined them all as:
var oPopup1 = {sUrl:'mylink1.html', nWidth:200,...};
Any thoughts? Thank you in advance.
maguskrool Guest
-
Struggling with variable arguments to block
Hi -talk, I'm having trouble dealing with a block that yields one parameter but declares two. I've pasted complete test code below. Basically,... -
[PHP-DEV] named function arguments (was: Proposal: Dangling comma in function
Christian Schneider wrote: Named parameters - i think is very good idea. I know i would use them. I'm really not sure about the correct... -
Crazy: NET::MySQL, query behaves differently depending on number of arguments.
Hi, This drove me nuts this morning, I sat on a problem that I have done a million times before in PHP but now in Perl it doesn't work. Probably... -
Function arguments
Hi Group, I have a question on overloaded function. What is the best way to pass the arguments so it is easy to maintain in future if function... -
[PHP] Function arguments
Hello, If you are worried about this issue your best option is to switch to an object oriented approach. all the best Hardik Doshi wrote:



Reply With Quote

