X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fevent.js;h=b2270ad9266c3724f2790334e3f67c58ebd4a9bb;hb=71efbdd3b26f3a283f8d4bfdcc7b6343142027b9;hp=4120af14ef080f78e31e1fbb6afe28f9d902da05;hpb=851846aabea72fe784b8a13cfb04cffecdb771b6;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index 4120af1..b2270ad 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -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 = ""; - // - // 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; });