| |
You are here: Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > ASp/Javascript question
Expert: robert mamayev - 9/2/2009
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>
Add to this Answer Ask a Question
|
|