Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Easy Date   Perfect Money   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 12-17-2006, 04:46 PM   #1 (permalink)
Junior Member
 
Join Date: 10-06-06
Posts: 19
iTrader: 0 / 0%
Latest Blog:
None

thenextbesthang is liked by many
Why does this not output?

Here is the code:

assume album is known, that it is a big array with the first group (position 0, 5, 10..) being the album number, the second group (position 1, 6, 11...) being the artist, the third group (position 2, 7, 12...) being the genre, the fourth group (position 3, 8, 13...) being the album picture, the 5th group (position 4, 9, 14...) being the song.
There are any number of albums
I want to create an array where in each element, I store an array of songs. No, for using objects is innefficient for this - no objects! Why is this code not alertying anything?
Code:
function opt_click() { var mydiv = document.getElementById("div1"); var myslt = document.getElementById("mymusic"); var art_sel = new Array(); var song_out = new Array(); var genre_out = new Array(); var image_out = new Array(); var m; for(i=0;i<myslt.options.length;i++) { if(myslt.options[i].selected) { m = myslt.options[i].value; art_sel.push(m); } } for(j=0;j<art_sel.length;j++) { for(var k=0;i<album.length;i+=album_size) { var g = album[k]; var found=false; { if(album[k+1] == art_sel[j]) { found = true; var song_at = new Array(); song_at.push(album[k+4]); song_out.push(song_at); } } } } for(i=0;i<song_out.length;i++) { for(s=0;s<song_at.length;s++) { window.alert(song_at[s]); } } }
thenextbesthang is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 12-18-2006, 01:13 PM   #2 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,067
iTrader: 0 / 0%
Latest Blog:
Moved In!

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
lol, more homework??
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-26-2006, 08:56 PM   #3 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,067
iTrader: 0 / 0%
Latest Blog:
Moved In!

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
[ delete this ]
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!

Last edited by Izzmo : 12-26-2006 at 08:57 PM. Reason: delete
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-29-2006, 12:31 PM   #4 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
I suggest adding a few more alerts() during the processing and building of the arrays. Also, it looks like the current code should only alert one time, at most, as you are wiping out any values in that array with each matching loop by reinitializing it (var song_at = new Array();song_at.push(album[k+4])). So song_out ends up being an array of song_at arrays with a max 1 entry in each song_at, and song_at ends up containing a single entry. Include alerts to tell you the values of myslt.options[i].value, album[k+1] and art_sel[j] at least.
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input (FORM) - Output (EMAIL)...Help me! maptomal Coding Forum 1 05-07-2006 12:23 PM
Need simple PHP date output.. POR-15 Depot Coding Forum 7 03-05-2004 01:15 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 11:05 PM.
© Copyright 2008 V7 Inc