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