FWIW, I've had issues in IE 6/7 with $(document).ready() not firing 
something in it's function. I've never dug into exactly why it happens, 
but found a workaround using setTimeout, like this:

$(document).ready(function() {
    setTimeout(
        function(){
           your code that isn't firing in IE here
        }
        , ( $.browser.msie ) ? 500 : 0
    )
});

So, maybe give that a try. FWIW, we (me and the folks I work with) found 
that 500ms seemed to do the trick, but 100ms didn't.

Also, If anyone knows why that's needed for some things to fire via 
$(document).ready, I'd love to know. We've also worked around it by 
doing these things:

1. putting our $(document).ready at the end of the HTML page (after the 
objects that we need ready).
2. used setTimeout() to check for the presence of the object(s) we need 
ready, and when they become ready, binding to them.

- Jack

Jack Gleeson wrote:
> In firefox the follow code works fine
>
>  $(document).ready(function() {
>              $(".form_con").hide();
>              $("[EMAIL PROTECTED]").change( function() {
>              if($.browser.safari) {
>                      if(this.value != 0)
>                      $(".form_con").hide();
>                      $("#form" + (this.value)).show();
>              } else {
>                      if(this.value != 0) {
>                      $(".form_con").hide();
>                      $("#form" + (this.value)).fadeIn("slow");
>                      }
>              }
>      });
> });
>
> But in IE the above code does not work, I thought it would be an issue
> with using swfobject with jquery buty I patched that up and the issue
> is still unsolved.
>
> It's pretty simple code, it hides 4 forms on load and then whatever
> option you select from the select list, it shows the form. It works
> fine in Firefox but in IE when I submit the page and do my regular
> expression checks it shows all forms which is not correct.
>
> Here is the on submit code,
>
> $(document).ready(function() {
>              $(".form").hide();
>              $("#form" + (<?php echo $contype; ?>)).show();
>              $('#conveyancing_list').attr('disabled', 'disabled');
>              $("[EMAIL PROTECTED]").change( function() {
>              if($.browser.safari) {
>                      if(this.value != 0)
>                      $(".form").hide();
>                      $("#form" + (this.value)).show();
>              } else {
>                      if(this.value != 0) {
>                      $(".form").hide();
>                      $("#form" + (this.value)).fadeIn("slow");
>                      }
>              }
>      });
> });
>
> $contype being the form from the previous page which was selected,
> this is so it shows the correct form errors.
>
> Thanks alot
>
>   

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to