0

can we pass an array to window.openDialog or window.open in javascript?

I know that we can pass parameters, but can this be an array?

0

1 Answer 1

1

yes we can ...

...window.openDialog is an extension to window.open. It behaves the same, except that it can optionally take one or more parameters past windowFeatures, and windowFeatures itself is treated a little differently.

The optional parameters, if present, will be bundled up in a JavaScript Array object and added to the newly created window as a property named window.arguments. They may be referenced in the JavaScript of the window at any time, including during the execution of a load handler. These parameters may be used, then, to pass arguments to and from the dialog window.

Sign up to request clarification or add additional context in comments.

2 Comments

so you mean if ppl is an array, i can pass it to the window as window.openDialog("url here","name","features",ppl);?inside the window window.arguments[0]=ppl......so how do i access the individual elements of my array?
var thearray=window.arguments[0] var elem1=thearray[0]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.