-1

This is my code:

$('#<some_object>').on( "keypress", function(event) {
  if (event.which == 13 && !event.shiftKey) {
    event.preventDefault(); 
      $.get('ajax.php', {
        action: '<some_text>',
        customer: ,
        value: $('#<some_object>').val()
      }, function(data) {
        $('#<some_object>').attr('value',data);
      }
    )
  }
});

I am having syntax error in majority in browsers, except my dev on which I use chrome. Please help me find the problem.

Any help appreciated.

1
  • 4
    customer: , there's an error on the comma (a value is missing) Commented Jul 22, 2014 at 11:53

1 Answer 1

2

The error is raising because of,

 $.get('ajax.php', {
  action: '<some_text>',
  customer: ,    ------------------------> ERROR FOUND             
  value: $('#<some_object>').val()
 }

Try to assign any empty values or even null to it to fix that error. The pointed line makes that object as an invalid one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.