redoc01
redoc01

Reputation: 2325

Jquery Live Click

I cant get the jquery live click to work, it works fine in IE8 but the live click event never fires in Mozilla.

   $("li.lidropdown").live("click", function(e) {

    alert("click");
    var text = $(this).text();
    $("a.linkplaylistbutton").text(text);


    if (text == 'Large Icons') {

        //RenderLargeIconsPlaylist();

    }
    else {

        //RenderDetailsPlaylist();

    }
    $("ul.uldropdownplaylistaddmedia").hide();
  });
<div id="ctl150" class="divplaylistcontainer">
   <a class="linkplaylistbutton" onclick="javascript:PlaylistViewClick(this)">Details</a>
   <a class="linkselectedbuttondropdown" onclick="javascript:PlaylistViewClick(this)"></a>
   <ul class="uldropdownplaylistaddmedia" style="display: block;">
        <li class="lidropdown">Large Icons</li>
        <li class="lidropdown">Details</li>
   </ul>
</div>

Upvotes: 0

Views: 223

Answers (2)

dnuttle
dnuttle

Reputation: 3830

I put your code into jsfiddle and tried it in Firefox, and I see the alert.

http://jsfiddle.net/BDPPN/

Upvotes: 0

Karoly Horvath
Karoly Horvath

Reputation: 96266

It should work, you might have a problem with the generated content, do an HTML validation on it. Firefinder could also help.

Also, this looks suspicios:

$("a.linkplaylistbutton").text(text);

did you mean:

text = $("a.linkplaylistbutton").text();

Upvotes: 1

Related Questions