From: Rasmus Sorensen Date: 2012-06-20T04:31:15+09:00 Subject: Re: Access array data - problem Maybe Marcus and Murphy... Im using Ruby with Sketchup (Googles free drawing program). In Sketchup its possible to make a webdialog which use html/JS which communicate with Ruby via a callback function. In the webdialog I define an array in html/Javascript like this: var layer_array = [108,190,95]; in Javascript it works fine with: Alert("layernum: " + layer_array[0]); => output is: ("layernum: 108") When I send it back to ruby and try: UI.messagebox ("layernum: " + layer_array); => output is: ("layernum: 108,190,95") But if try this: UI.messagebox ("layernum: " + layer_array[0]); => output is: ("layernum: 57") Maybe its because it sees it as a plain string as Murpy suggest. It has to be said, if I define an array in Ruby, everythings work fine. It seems to go wrong when send from JS/html to Ruby. Any ideas how to work around this problem? -Rasmus -- Posted via http://www.ruby-forum.com/.