- testFoo = undefined;
- $('#first').load(url('data/test2.html'), function() {
- ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM');
- ok( testFoo == "foo", 'Check if script was evaluated after load' );
+
+ jQuery('#first').load(url('data/test2.html'), function() {
+ equals( jQuery('#foo').html(), 'foo', 'Check if script evaluation has modified DOM');
+ equals( testFoo, "foo", 'Check if script was evaluated after load' );
+
+ start();
+ });
+});
+
+test("load(String, Object, Function)", function() {
+ expect(2);
+ stop();
+
+ jQuery('<div />').load(url('data/params_html.php'), { foo:3, bar:'ok' }, function() {
+ var $post = jQuery(this).find('#post');
+ equals( $post.find('#foo').text(), '3', 'Check if a hash of data is passed correctly');
+ equals( $post.find('#bar').text(), 'ok', 'Check if a hash of data is passed correctly');
+ start();
+ });
+});
+
+test("load(String, String, Function)", function() {
+ expect(2);
+ stop();
+
+ jQuery('<div />').load(url('data/params_html.php'), 'foo=3&bar=ok', function() {
+ var $get = jQuery(this).find('#get');
+ equals( $get.find('#foo').text(), '3', 'Check if a string of data is passed correctly');
+ equals( $get.find('#bar').text(), 'ok', 'Check if a of data is passed correctly');