views:

46

answers:

2

I'm using following Code to add status-messages via PHP & Javascript (Ajax):

$(document).ready(function(){
    $("form#status_form").submit(function(){
     var s_autor = $('#s_autor').attr('value');
     var s_status = $('#s_status').attr('value');
     $.ajax({
      type: "POST",
      url: "/request.php",
      data: "s_autor="+ s_autor +"& s_status="+ s_status,
      success: function() {
       $('#show').load("/request.php", function() {
        $(this).fadeIn("slow", function() {
         setTimeout(function() {
          $("#show").fadeOut("slow", function() {
           $("#show").slideUp("slow", function() {
            $("#s_status").val("Statusnachricht", function() {
             $(this).empty();
            });
           });
          });
         }, 2000);
        });
       }); 
      }
     });
     return false;
    });
});

After a friend telling me it doesn't work in IE, I used JSLint to validate the Code... JSLint gave me this Report:

    Error:

Implied global: $ 1,2,3,4,5,10,11,13,15,16,17, document 1, setTimeout 12

Does someone know how to correct this error? I really don't know how to change it correctly... Would be awesome if you could help me : )

A: 

It may be a strange parsing error. Have you tried changing all your single quotes to double quotes?

For example change all strings like $('#show') to $("#show").

changes nothing : S
Kaley
+1  A: 

You should remove the space character in the line :

data: "s_autor="+ s_autor +"& s_status="+ s_status,

between the "&" and s_status.

Fabien Ménager
doesn't work : S
Kaley