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); 
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.