Thursday, 10 November 2016

Passing Array to Java Script Function

You can an array to JavaScript function as an argument. In side of function you can handle this argument in any other programming language. Take a look on following example : 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Array to Java Script Function : Girfa</title>
<script language="javascript">
     function ardemo(ar)
                document.write("[" +ar[i] + "] ");

<h2 align="center">Passing Array to java script function</h2><hr />
Check : <input type="button" value="Click to check" onclick="ardemo(new Array('.jpg','.gif','.png'))" />


Download HTML File

No comments:

Post a Comment