• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

Javascript code - missing tag ?

Hi all,

I've got a missing brace or bracket in this code but cannot see it.

Can anyone help please?

Here is the code:

<script type="text/javascript">
function submitdata() {
$("#ajax-form").submit(function(){$.post("submit.php",$("#ajax-form").serialize(),
            
			function(data){
			   $('#jqm').attr('src', $('#jqm').attr('src'));
              
            }
        );
        return false;
    };
</script>

Open in new window


Thanks
0
error77
Asked:
error77
1 Solution
 
rushtoshankarCommented:
You have 3 open '{' - One near submitdata, submit(function(){ and the last one in function(data){

but only have two close

          }
        );  --> you might have seen this as ' } '
        return false;
    };
0
 
leakim971PluritechnicianCommented:
Check on this page : http://jsfiddle.net/xbYyB/

(place your cursor near the bracket and parentheses)
function submitdata() {
    $("#ajax-form").submit(function(){
        $.post("submit.php",$("#ajax-form").serialize(),
            function(data){
                $('#jqm').attr('src', $('#jqm').attr('src'));
            }
        );
        return false;
    });
}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now