I don't really fully understand what problem you are having.... Can you
show an example of what's it's doing... and what you want it to do?
The code you sent looks fine... except that the last string after you
split the string will be an empty string because you have a "|" at the
end of the string.
Are you sure "window.cname" is passing what you think it is? Have you
debugged it and checked to see exactly what you are getting?
Sincerely,
Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://bgies.com http://nocrappyapps.com
http://bistroblurb.com http://forcethetruth.com
http://ihottonight.com
-----------------------------------------------------------------------
Everything in moderation, including abstinence (paraphrased)
Every person is born with a brain... Those who use it well are the successful
happy ones - Brad Gies
Adversity can make or break you... It's your choice... Choose wisely - Brad Gies
Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead
On 18/11/2010 9:24 PM, Nishant Bhargava wrote:
I am trying to pass an array from Java to JavaScript by converting the
array into a string with the help of delimiter and later splitting in
JavaScript with the split function in JavaScript. Now the problem
arrives if I display String in the form of alert the String is coming
in the JavaScript and is displaying the right output which I want but
the split function doesn't work here for unknown reason but the same
function works if I give the String for same name with the same type
of values defined in the code. The problem is in JavaScript for sure
as the string I am fetching from is being displayed in alert. Please
suggest something, I worked on the problem on emulator only.
This is the function in JavaScript
function load()
{
//var stringFromJava =
"Nishant|Amit|Ankit|Ashok|Working|Ishaan|
Hallelujah|Floor|Haroon|Fish|Wasim|";
var stringFromJava = window.cname;
var names = stringFromJava.split("|");
sortnames(names);
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en