I hardly ever use javascript and when i do it is only alert() so my problem is probably easily resolves but i have checked books and w3schools and cannot find the problem.
I cant get the pic[1] to write out to the screen
note: I also tried declaring it var pic=new array()
Edit........ N/M turns out the A in new Array() has to be capitalised, working nowCode:<script type='text/javascript'> var pic[]; pic[0] = 'gallery/1.jpg'; pic[1] = 'gallery/10.jpg'; pic[2] = 'gallery/2.jpg'; pic[3] = 'gallery/3.jpg'; pic[4] = 'gallery/4.jpg'; pic[5] = 'gallery/5.jpg'; pic[6] = 'gallery/6.jpg'; pic[7] = 'gallery/7.jpg'; pic[8] = 'gallery/8.jpg'; pic[9] = 'gallery/9.jpg'; document.write(pic[1]);document.write(pic[2]); </script>
try var pic = new Array();, javascript is case sensitive
Hope that helps
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks