johnsmith153 Posted October 7, 2008 Share Posted October 7, 2008 This shows 0,1,2 - how do I get it to show bobby, jimmy, dave ? <script> start1="hello***there***bobby**jimmy**dave"; start2=start1.split("***"); start3=start2[2].split("**"); for (var i in start3) { alert(start3); } </script> Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/ Share on other sites More sharing options...
johnsmith153 Posted October 7, 2008 Author Share Posted October 7, 2008 Obviously I used alert(i); to get 0,1,2 as alert(start3); would show the whole array. - this was just a typo. And obviously alert(start3); is what I want Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/#findComment-658929 Share on other sites More sharing options...
johnsmith153 Posted October 7, 2008 Author Share Posted October 7, 2008 Another typo alert(start3); is what I want. Am obviosuly in a rush. Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/#findComment-658930 Share on other sites More sharing options...
johnsmith153 Posted October 7, 2008 Author Share Posted October 7, 2008 Ok, its not me. My [ i ] is being removed by this forum alert(start3[i]); is what I want Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/#findComment-658933 Share on other sites More sharing options...
obsidian Posted October 7, 2008 Share Posted October 7, 2008 Ok, its not me. My [ i ] is being removed by this forum alert(start3[i]); is what I want Yes, the square braces with the nested 'i' you are attempting to put in your text is the BBCode for italic, so it gets parsed out. So, with the start3 sub i, is your problem fixed, or do you still have a question? Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/#findComment-659145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.