Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Array back to Javascript

Status
Not open for further replies.

Navitas

Programmer
Jul 20, 2004
24
0
0
GB
Hi,

I have a .net class that compiles to a COM class from which I use Javascript to call various methods etc.

I am wanting to call a function that returns an array back to Javascript. If I set the .net function to return an object I can then see the returned object in Javascript - however it's not an array that can be accessed using normal 'arrayname[1]' notation.

If I debug the javascript code I can see that an array variant has been returned, but the array items are listed with round brackets rather than square!

Many thanks for any assistance!
 
The work around I used in the end was to convert the .net array to a delimited string and pass it back as a string.

In the javascript code I used the string.split method to create a new array.

Seems stupid but at least it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top