Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Error: Uncaught SyntaxError: missing ) after argument list - JS function

I used arrays for my table :

var html = [];
$.each(data,function(index,item){
   no++;
   var arr = [
    '<tr>',
       '<td>'+ no +'</td>',
       '<td>'+ item.name +'</td>',
       '<td>'+ item.address +'</td>',
       '<td>',
         '<button type="button" class="btn btn-info btn-sm" onclick="pickData('+ item.id +','+ item.name +','+ item.address +')"><i class="fas fa-plus-circle"></i></button>',
    '</td>',
    '</tr>'
    ].join('\n');
    html.push(arr);
});
$('#table').html(html);

and this is the function :

function pickData(id, name, address) {
    $("#id").val(id);
    $(".name").val(name);
    $(".address").val(address);
}

The error is :

Uncaught SyntaxError: missing ) after argument list

Where is the problem?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

From the way you write code, Please check your variable (especially address and name) value from console.log, Make sure it doesn't contains space on it.

Ie. "Malibu" Vs "Malibu street",

If it does contains space, you need to quotes those variable value. Because when you're not place quotes, your function would be invoked like this: pickData("yourId", "yourName", Malibu street)

Meanwhile the function itself expect like this: pickData("yourId", "yourName", "Malibu street")

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!