I have a library that generates jquery that I would like to test with
qUnit, but I'm running into problems.

The library generates attaches events during the ready event, but
events are not being wired up when I have a unit test on the page in a
sepearate ready event.  My code looks like this.
<body>
 <div id="main">
        <a id="l2" href="#">Execute Function Test</a>
 </div>
</body>
--script source tags here
--this is the generated code
<script type="text/javascript">/*<![CDATA[*/
        $(document).ready(function(){
                $('#l2').click(function(){alert('hello')});

});

//]]></script>
-- and now the tests
<script type="text/javascript">
$(document).ready(function(){
                        module("when anchor is generated ");
                        test("should create anchor with correct id",function(){
                                var $a = $('#l2');
                                ok($a.length === 1);
                        });
});
</script>
the click event will not fire for the anchor.

Any suggestions?

Thanks,
John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to