Jump to content

Problem with "missing ) after argument list"


mikwit

Recommended Posts

So I know this should be an easy fix, but I've tried every thing I can think of and still nothing will get this error to go away.  I looked for escaped quotations, but I couldn't find any, and I use textwrangler to do editing so it would have been more visible if that was the problem.  Also I'm new to the whole javascript thing, but have a decent background in php.  Here's the code.  I'm getting the error in firebug "missing ) after argument list  });\n"  Just as a note I'm using jquery with flot.

$(function () {
    var options = {
        lines: { show: true } ,
        xaxis: { min: 0 }
        };
    var data1 = [];
    var placeholder = $("#placeholder");
    var show1= 0;
    $.plot(placeholder, data1, options);

    
    // fetch one series, adding to what we got
    var alreadyFetched = {};
    
    $("input.fetchSeries1").click(function () {
    data1= [];
    if (show1 == 0)
    { 
    show1 = 1; 
    }
    else
    {
    show1 = 0;
    }
       plot(show1);
    }
    });  //Error is here
    
function plot(show1){
        var weight = document.getElementById("weight").value ;
        var dataurl = "http://drink.mikwit.com/test3_data.php" + "?w="+ weight";
if (show1 == 1) {
var dataurl = dataurl + "&opt1=1";
}
        // then fetch the data with jQuery
        function onDataReceived(series) {
            // extract the first coordinate pair so you can see that
            // data is now an ordinary Javascript object
                data1.push(series);
            }
            
            // and plot all we got

        
        $.ajax({
            url: dataurl,
            method: 'GET',
            dataType: 'json',
            success: onDataReceived
        });
$.plot(placeholder, data1, options); 
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.