jQuery(document).ready() Type error on WebKit based Browsers

jQuery(document).ready() Type error on WebKit based Browsers

Hi there,

I looked for some hours now on the Internet trying to find an solution, or at least an explanation, to my problem but haven't found anything yet.

On Firefox it all works just fine, on IE7 it works with some minor bugs (as expected) but on any WebKit based Browser like Safari, Chrome, Konqueror and Opera, it refuses to work. Instead, I get this Error Message:

message: Statement on line 3: Type mismatch (usually non-object value supplied where object required)

here is the Code:

jQuery.noConflict();

jQuery(document).ready(function(){  //line 3 is here

   jQuery("#dir").change(function () {
         jQuery("#preview").hide("slow",function(){
            jQuery("select option:selected").each(function () {
               jQuery("#preview").empty();
               requestXML();
               jQuery("#preview").show("slow");   
            });
         });
    })
    .change();
             
   jQuery("input[name=mode]").change(function(){
       if (jQuery("input[name=mode]:checked").val() == "add_blank") {
         jQuery("#preview").hide("slow", function() {
            jQuery("#preview").empty();   
         });
         jQuery("#dir").attr("value",";-;");
         jQuery("#dir").attr("disabled", "disabled");
      } else {
         jQuery("#dir").removeAttr("disabled");
      }
   })
   .change();
   
});

   function requestXML() {
      jQuery.ajax({
         type: "GET",
         url: "/cgi-bin/apps/load_preview?directory=" + jQuery("#dir").val(),
         dataType: "xml",
         async: false,
         success: function(xml) {
            jQuery(xml).find("picture").each(function(){
               jQuery("#preview").append("<img class='preview' src='/" + jQuery(this).find("reference").text() + "' />")
            })
         }
      });
   }


This little code loads a perl handler on <select>.change(), which returns a xml File with img references, which in turn are interpreted and shown with a nice jQuery show() Effect. Like i said, works great on FF, works on IE7 and 6, but not in Opera, Safari, etc.

I'm new to AJAX and jQuery and only learned how to use it yesterday so I welcome any constructive comments which can help me along.