开发者

Jquery load error in IE 6

I'm using this script to add a comment and to load the server response:

        $r="            $('#somestuff').hide();
            $('.button').click(function() {
 // validate and process form
 // first hide any error messages
 $('#somestuff').fadeIn(5000);
});
$('#subm').click(function() {
        // validate and process form
        // first hide any error messages
    $('.error').hide();

        var email = $('input#email').val();
        var id = $('input#id').val();
        if (email === '') {

      $('input#email').focus();
      return false;
    }
        var phone = $('textarea#body').val();
        if (phone === '') {

      $('input#body').focus();
      return fa开发者_StackOverflow中文版lse;
    }

        var dataString = '&email=' + email + '&body=' + phone + '&id=' + id;
        //alert (dataString);return false;

        $.ajax({
      type: 'POST',
      url: '/helpdesk/idejas/ratingupdate/',
      data: dataString,
      success: function(html) {
      $('#somestuff').html('<div id=\"message\" class=\"success large\"></div>');
        $('#message').html('Paldies par ieteikumu!').hide()
        .fadeIn(1500);
        $('#somestuff').hide('slow');
        $('#iddiv').show('slow');
        $('.comments').append(html);
        $('.comments li:last').fadeIn(1500);
      }
     });
    return false;
    });

"
 ;

Everything works fine in FF, Chrome, IE 7,8, but IE 6 breaks. It displays these chars: ? and I have no Idea how to fix this. This is happening sitewide. What could be the problem? I ran it through JSLint, and fixed all the bugs.


This is not related to your question and I really don't mind getting downvoted just because I did not post this as a comment since most of the inexperienced people never bother to check the comments - They just scroll to the answers and get it over it.

I kindly request you to follow the (eternal) good programming practices.

I (not sure about others) get really put off when reading code which is not styled properly, forget its correctness.

Such badly indented code, badly chosen variable names (you have an HTML id called 'someStuff' - seriously?). The next time you try to make some changes to the code, you yourself would waste a few precious minutes trying to figure out what stuff were you trying to display using 'someStuff'!

And especially on a site like StackOverflow, where you need to explain your problem to the people as clearly as possible for the quickest and best solutions, is why your code (the best description of your problem) needs to be as clear as possible. Do take time to format your code in StackOverflow as well. It is totally worth it, trust me.

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜