(Edit* - code below)
But, it's far from complete and it's probably all completely wrong and mangled. Sorry. I'm using code from the chapter and trying to make it work for the assignment, but for now all I want is the Add Player button to work, once that works, I will try and figure out the rest. So, if you could just look over the add contact part and let me know what could be throwing me off, I'd appreciate that so much. Thank you for reading all of this.
Also, sorry again for how horrible the code will probably look. Like I said, I'm in way over my head here >_<
Maia Miller wrote:(you can view source from there I figured..)
Making people work hard to help you is less likely to get you the help you need.
Rather, pare the problem down to the smallest example that demonstrates the issue and post it. People here will be glad to help you, but you must put your effort into making it as easy to help you as you can.
Sorry, I read that in the FAQ, but I figured it'd be easier since my code is so long. I apologize. I don't see how to edit my original, so I'll post here instead. (Edit: found the edit button, ha, but I don't know which part of the code to single out and post since it seems as though they are all linked. But, if you'd like me to shorten it and only post a certain part, I'll do so. Sorry again, first time posting and completely out of my league with the JS stuff)
Here is the code that I have:
Sorry it's so long.. The HTML part is here:
And the link in the first post can show how it looks in the browser I guess. Sorry again, hope this helps.
We're all happy (possibly giddy, even) to help, but we have to have a starting place.
The first thing that I see is that the first thing you do is loop over the existing contact list (I assume, I didn't see where it's defined) and promptly overwrite whatever is in there. If you're trying to figure out where the end of the list is, you'll want to do it *before* adding anything to the list (in other words, there should be a complete loop through the list first if you're going to do it like that).
You'll also run in to a problem where you delete a contact from the middle of the list: the count of contacts will no longer line up one-to-one with the map key you're using (in other words, the third object in the list might be contact #4, if you've deleted #1, 2, 3) and this might also cause a data integrity issue.