-1

My SO search tells me that this error occurs when you have an extra bracket, or another formatting error (source, source etc.). But I have gone through my code snippet again and again, and haven't been able to spot any such problem. But I am still getting the error:

Uncaught SyntaxError: missing ) after argument list

Following is my script. The question is why I am getting this error, and how to resolve this.

<?php 

$(document).ready(function() {
    alert("scripts.js detected");//check

    alert($("input#theInput").val());//check



    /*
    *
    */
    $("form#theInputForm").submit(function(event) {
        event.preventDefault();

        if ($("input#theInput").val() == '') {
            alert("Please enter a the value.");
        } else {

            $(".inputFormWrapper").css("height") = "10vh";
            $(".otherSectionWrapper").show();


            var theEntered = $("input#theInput").val();


            $.ajax(
                url: "get_the_data_two.php",
                method: "get",
                data: {
                    theFromUser: theEntered
                },
                success: function(otherData, textStatus, jqXHR) {

                    alert(otherData);//check

                },
                error: function(jqXHR, textStatus, errorThrown) {
                    alert("textStatus: " + textStatus + " \nerrorThrown: " + errorThrown);//check
                }
            );

        }

    });




});

?>
Shy
  • 542
  • 8
  • 20

2 Answers2

3

Two things :: Assignment of height is not proper and ajax syntax.

Your else part should be as follows:

{
    $(".inputFormWrapper").css("height","100px");
    $(".responseSectionWrapper").css("height","90px");


    var tmsiEntered = $("input#tmsiInput").val();


    $.ajax({
        url: "get_auth_data_two.php",
        method: "get",
        data: {
            tmsiFromUser: tmsiEntered
        },
        success: function(responseData, textStatus, jqXHR) {

            alert(responseData);//check

        },
        error: function(jqXHR, textStatus, errorThrown) {
            alert("textStatus: " + textStatus + " \nerrorThrown: " + errorThrown);//check
        }
    });

}

When in doubt, check the API: http://api.jquery.com/css/

Tieson T.
  • 20,774
  • 6
  • 77
  • 92
Poonam
  • 4,591
  • 1
  • 15
  • 20
-1

In my callback function i have missed , in argument list Example: #####

function one(arg,callback){
  alert("hay $(arg)");
  callback();
}

one('avinash'function(){ //one('avinash',function(){ if ',' missing will get error
  alert("after execution");    
});
Vaibhav Vishal
  • 6,576
  • 7
  • 27
  • 48
Avinash Khadsan
  • 441
  • 3
  • 6