?
Solved

JS - How do I parse a colon delimited string into an Array?

Posted on 2010-08-25
7
Medium Priority
?
795 Views
Last Modified: 2013-11-08
JS - How do I parse a colon delimited string into an Array?

  var bdlist = '36:24:12:4'; -- this actually comes from database

???????????

  for ( var j=0;j< bdlist.length; j++ ){
      alert(bdlist[j]);
  }
0
Comment
Question by:bcarlis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
7 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 33526908
use : bdlist = bdlist.split(":")
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 500 total points
ID: 33526918
bdlist[0] equal 36
bdlist[3] equal 4
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 500 total points
ID: 33526928
test page :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script language="javascript">
	var bdlist = '36:24:12:4'; // -- this actually comes from database
	bdlist = bdlist.split(":");
	for ( var j=0;j< bdlist.length; j++ ){
		alert(bdlist[j]);
	}
</script>
</body>
</html>

Open in new window

0
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 33529353
Wow. 3 comments for this? Where do you get the time Leakim?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 33530237
lol... and it's seems, it's not suffisant : the question is still open...
0
 
LVL 2

Author Closing Comment

by:bcarlis
ID: 33531555
You have to give me time to look at it..
:>) I posted before I left work yesterday!

Thank you, my JS is rusty... I remember now..
0
 
LVL 82

Expert Comment

by:leakim971
ID: 33535581
I understand, don't worry about our jokes! Thanks a lot for the points! You're very welcome!
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question