We're working on a music page to list albums, songs and add lyrics.
We have a "View More" below each album, clicking that shows you the song list (using jquery, making a hidden div slide down). We'd like to add a variable to the URL if someone clicks it (or remove it if they "hide") the songs, so that it creates a permalink to that section. If someone passes that it'll automatically show that div open.
So a link should look something like this http://www.greendayauthority.com/music/catalog.php#album=1039 or http://www.greendayauthority.com/music.catalog.php?album=1039
(Could someone help me figure out the better way to use this? Between the "#" and "?"
We want to do the same thing for lyrics of individual songs. If someone clicks a song title, it adds another variable to the URL with the song ID.
So if someone clicks a song title it'll then be http://www.greendayauthority.com/music/catalog.php?album=1039&song=3
We can handle all the code to make all the stuff appear on the page, but I don't know how to add a variable onto the page with javascript, so that if someone wants to link the lyrics to a specific song, they can share that link and when they visit, the proper divs will be shown.
Can someone help point me in the right direction? Any tips on a better way to do this are also welcome.
Thanks!