Xavi
Xavi

Reputation: 2594

SyntaxError: missing : after property id

It shows Syntax Error: missing : after property id near '<img src="loading.gif" />';`

 <script>
    $(document).ready(function() {
        $("#client").on("change", function() {
          var clientid=$("#client").val();

           $.blockUI(

           { 

            '<img src="loading.gif" />';
                timeout: 5000

           }); 

        $.ajax({
                type:"post",
                url:"clientnetworkpricelist/yourfile.php",
            data:"title="+clientid,
            success:function(data){
                 $('.blockUI').hide();
                 $("#result").html(data);
            }
        }); 
        });
    });
    </script>

Upvotes: 0

Views: 17881

Answers (2)

BenM
BenM

Reputation: 53198

Property values of an object need to separated by commas, not semicolons. Your code should be:

message: '<img src="loading.gif" />',
timeout: 5000

For example, your blockUI() function should be called as follows:

$.blockUI({ 
    message: '<img src="loading.gif" />',
    timeout: 5000
}); 

Upvotes: 0

Curtis
Curtis

Reputation: 103358

Change blockUI script to:

$.blockUI({
     message: '<img src="loading.gif" />',
     timeout: 5000
}); 

Upvotes: 3

Related Questions