I have a site which lists the basic information of CDs and allows the user to click a link to see detailed information regarding each CD. I've been doing that for a long time by just putting the detailed information in a DIV and using a script to toggle the visibility of that DIV. Unfortunately, I've reached the point where that bloats the page too much for it to load efficiently.
My idea is to use an AJAX call and simply load the detailed information from an external file whenever the user clicks the link. This is basically the code I've tried to use for that, but using it would require me to individually assign an ID to every DIV, which is unreasonable.
I've kicked around various ideas--making a similarly-functioning code that applies to classes instead, using a script to apply an ID to an element when it is clicked and then calling the external page into that, etc.--but none of them have worked out.
Can anyone give some specific answers to this problem or even help me think of it from a different angle?