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> Quote 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 Quote 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. Quote 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 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/127377-javascript-for-very-simple/#findComment-659145 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.