refactor specialAll into add and remove hooks for existing special events, live now...
[jquery.git] / test / unit / event.js
index 4120af1..b2270ad 100644 (file)
@@ -47,15 +47,11 @@ test("bind(), no data", function() {
 
 test("bind(), iframes", function() {
        // events don't work with iframes, see #939 - this test fails in IE because of contentDocument
-       // var doc = document.getElementById("iframe").contentDocument;
-       // 
-       // doc.body.innerHTML = "<input type='text'/>";
-       //
-       // var input = doc.getElementsByTagName("input")[0];
-       //
-       // jQuery(input).bind("click",function() {
-       //      ok( true, "Binding to element inside iframe" );
-       // }).click();
+       var doc = jQuery("#loadediframe").contents();
+       
+       jQuery("div", doc).bind("click", function() {
+               ok( true, "Binding to element inside iframe" );
+       }).click().unbind('click');
 });
 
 test("bind(), trigger change on select", function() {
@@ -494,7 +490,7 @@ test("toggle(Function, Function, ...)", function() {
 });
 
 test(".live()/.die()", function() {
-       expect(52);
+       expect(53);
 
        var submit = 0, div = 0, livea = 0, liveb = 0;
 
@@ -583,6 +579,9 @@ test(".live()/.die()", function() {
        jQuery("#foo").trigger('click');
        equals( clicked, 2, "die with a context");
 
+       // Test binding with event data
+       jQuery("#foo").live("click", true, function(e){ equals( e.data, true, "live with event data" ); });
+       jQuery("#foo").trigger("click").die("click");
 
        // Verify that return false prevents default action
        jQuery("#anchor2").live("click", function(){ return false; });