jQuery: Testing for arrays
The jQuery Code START
<script type="text/javascript" src="./jquery-1.5.1.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var array = [1, 2, 3, 4, 5, 6, 7, 8];
if($.isArray(array)) {
$("div").text("The data is an array");
} else {
$("div").text("The data is not an array");
}
});
</script>
<style type="text/CSS">
<!--
.code { color: red; }
.back { background-color: yellow; }
-->
</style>
</head>
<body>
<h1>jQuery: Testing for arrays</h1>
<div></div>