118
rated 0 times
[
123]
[
5]
/ answers: 1 / hits: 71037
/ 12 Years ago, mon, april 9, 2012, 12:00:00
Code example:
<script>
var data = new Array();
data[0] = 'hi';
data[1] = 'bye';
</script>
<script>
alert(data[0]);
</script>
This gives the following error: data is not defined
How do you make something like this work? Especially if the first <script>
block is being loaded on the page by ajax, and the second block is working from it. jQuery solution is acceptable.
More From » jquery