Reading Javascript with Javascript?

Discussion in 'jQuery' started by mokimofiki, Dec 5, 2011.

  1. #1
    Yeah I'm not sure how else to work the question.

    Before the function below runs we have the first list being clicked to generate values with the class premiumgenre and id's that correspond to that entry into the field with id of secondlist. After that generates we run the below function to try to create a third list in the exact same way but nothing seems to happen.

    The list items that are to be clicked to activate the below function are generated with Javascript and are not in the source code but can be seen working by using firebug.

    $(document).ready(function() {		
    	$(".premiumgenre").click(function() {
               var genre_id = $(this).attr('id');
    		$.get("database_lookups/premium_program_programs.php?genre=" + genre_id,
    			function(data){
    				$("#thirdlist").html(data);
    		});
    });
    Code (markup):
    Example of a links that are generated that should be clicked to activate the function above:
    <li class="premiumgenre" id="4">Rock</li>
    <li class="premiumgenre" id="7">Pop</li>
    Code (markup):
     
    mokimofiki, Dec 5, 2011 IP
  2. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #2
    mokimofiki, Dec 5, 2011 IP