Active Server Pages Programming (ASP)/ASp/Javascript question

Advertisement


Question
How do I use array in java script? Do you have an example?

Answer
Creating an array is slightly different from creating a normal variable. Because JavaScript has variables and properties associated with arrays, you have to use a special function to create a new array. This example shows how you would create a simple array, store values to it, and access these values.

<script type="text/javascript">
<!--
var myArray = new Array();

myArray[0] = "http://www.";
myArray[1] = "ideajets.";
myArray[2] = "com";

document.write(myArray[0] + myArray[1] + myArray[2]);
//-->
</script>

display:
http://www.ideajets.com

Hope this helps!!

Please read my other article here:
<a href="http://www.ideajets.com/articles.asp">Author Blog</a>

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


robert mamayev

Expertise

Main focus is classic ASP, Oracle 9i and 10g and MySQL databases

Experience

I am an expert with classicASP. I can answer any questions you might have about the ASP language, HTML, website design and development. I am not an expert in ASP.NET yet, so please don't ask me any questions specific to ASP.NET. Also, be sure to visit my IdeaJets website.

Publications
Article List

Education/Credentials
BS in Computer Science, Queens College, NYC

Awards and Honors
Oracle Database Certified Professional (9i databases)

Past/Present Clients
Pfizer, MasterCard

©2012 About.com, a part of The New York Times Company. All rights reserved.