Split a String into 2 Variables in javascript -


i wanting convert string 2 variables..

i have created variable , using substring split it, can't seem working.

if create alert message display's orignal variable want split (so know there there)

my code looks this:

// variable 'ca' set xml element response alert(ca); // displays string (eg. 123456789) - display fine alert(ca.substring(0,1));  // should alert 1 stops , nothing displayed 

but add ca = "123456789"; below, works..

ca = "123456789"; alert(ca); // displays string (eg. 123456789) - display fine alert(ca.substring(0,1));  // should alert 1 stops , nothing displayed 

however variable ca has set , display right before substring used..

anyone know might doing wrong?

your variable doesn't contain string, contains else, number.

convert value string, able use string methods on it:

ca = ca.tostring(); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -