Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:02:24+00:00 2026-05-31T13:02:24+00:00

I am getting the error missing ) after argument list in my Firebug console.

  • 0

I am getting the error missing ) after argument list in my Firebug console.

emissing ) after argument http://a8.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/393131_320846714645076_100001592501599_911297_470580896_n.jpg

My question is how to pass $char_data variable in JavaScript function as a argument

Define php variable:

<?php 
$chart_data = "['NBA',1],['NFL',2],['MLB',3],['NHL',4]"; 
$div = "graph";
?

Call JavaScript function with define argument

<script>
dynamicChartArray('<?php echo $div;?>','<?php echo $chartdata;?>')
</script>

A function of JavaScript

<script>
function dynamicChartArray(div,chartdata){
var myData = new Array(chartdata);
var myChart = new JSChart(div, 'pie');
alert(chartdata+div);
}
<script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:02:25+00:00Added an answer on May 31, 2026 at 1:02 pm

    Rather than creating an array out of a string in javascript, why not just just get the PHP to output it as an array to start with?

    Just add an extra set of [] which javascript reads as an array.

    $chart_data = "[['NBA',1],['NFL',2],['MLB',3],['NHL',4]]"; 
    

    then ditch the quotes on the output (which are responsible for causing the error messages)

     dynamicChartArray('<?php echo $div;?>', <?php echo $chartdata;?>);
    

    and then myData can just equal chart data (since its already an array)

    var myData = chartdata;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a firebug error: missing : after property id error source line: if(jQuery.inArray(mmDialogButton.CANCEL,
I'm getting a missing template error after I try rendering a partial from a
I keep getting an error, missing { after property for the following code. <script
I am getting a syntax error Missing operand after 'Price' operator with the following
I'm getting the following error: missing : after property id in line data:{$(#msgForm).serialize() +
I'm getting the following error on the line of code below: Syntax error (missing
I started getting the error, error C2059: syntax error : 'default argument' for a
I'm getting a compile error (MS VS 2008) that I just don't understand. After
This handler doesn't like the $page parameter in the eval function, getting error missing
I'm getting an error when the 'insertcommand' is executed telling me that I'm missing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.