Ajax Request Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings ajax syntax error unexpected token and policies of this site About Us Learn more about Stack
Ajax Syntax Error Invalid Character
Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Jquery Ajax Syntax Error
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Ajax Json Syntax Error
it only takes a minute: Sign up Ajax.request throws a syntax error, but returns the correct value up vote 0 down vote favorite I have a bunch of Ajax requests that execute just fine, but I end up with a syntax error in my browser. Can anyone see what's wrong with my request below? function getName(refId) { var resp = syntax error unexpected end of input ajax ''; new Ajax.Request('/servlet/GetName', { method:'post', parameters: {'requestType':'ref', 'value':refId}, onSuccess:function(transport) { setName((String(transport.responseText)).trim()); } }); } edit: This also seems to only throw the error the first time it gets called. If I clear the console, I don't continue to get errors. javascript ajax syntax prototypejs share|improve this question edited Dec 28 '11 at 21:50 Rob W 203k32464457 asked May 28 '09 at 16:06 Jesse 1,2421118 what is the syntax error? –mkoryak May 28 '09 at 16:17 syntax error localhost:8080/servlet/
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this ajax syntaxerror site About Us Learn more about Stack Overflow the company Business Learn ajax parsererror syntaxerror more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x jquery ajax syntaxerror expected expression got ' ' Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Simple http://stackoverflow.com/questions/921711/ajax-request-throws-a-syntax-error-but-returns-the-correct-value jquery ajax request syntax error up vote 1 down vote favorite I have a simple ajax request function and theres some syntax error im missing. Just need a second pair of eyes.. thanks function GetPaginationPage(array) { $.ajax({ type: "POST", url: "includes/get_pagination_page.php", data: array, success: function(data){ function (data) { $('.contestants_list').append(data); }}; }); }; jquery ajax share|improve this question asked Jul 12 '12 at 14:49 Jonah http://stackoverflow.com/questions/11454483/simple-jquery-ajax-request-syntax-error Katz 2,18394978 try to use Object instead of Array –Onheiron Jul 12 '12 at 14:52 You have two extra semicolons. One causes a syntax error, the other doesn't. Use JSLint within JSFiddle or JSLint directly. You also have an extra function(data){...} –Kevin B Jul 12 '12 at 14:53 2 You have nested anonymous functions in your success callback, that doesn't look right. –Stefan H Jul 12 '12 at 14:54 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted Try this function GetPaginationPage(array) { $.ajax({ type: "POST", url: "includes/get_pagination_page.php", data: array, success: function(data) {$('.contestants_list').append(data);} }); }; share|improve this answer answered Jul 12 '12 at 14:56 John Need 435 add a comment| up vote 1 down vote The problem would be that you're rewrapped the function of the success envent, also you add a semicolon at the end of the function Do remove the two function in the success event and the semicolon at the end, should look like this $.ajax({ type: "POST", url: "includes/get_pagination_page.php", data: array, success: function(data) { $('.contestants_list').append(data); } }); Notes A tip when you have this t
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site http://stackoverflow.com/questions/5061310/jquery-returning-parsererror-for-ajax-request About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up jQuery returning “parsererror” for syntax error ajax request up vote 91 down vote favorite 18 Been getting a "parsererror" from jquery for an Ajax request, I have tried changing the POST to a GET, returning the data in a few different ways (creating classes, etc.) but I cant seem to figure out what the problem is. My project is in MVC3 and I'm using jQuery 1.5 I have a Dropdown and ajax syntax error on the onchange event I fire off a call to get some data based on what was selected. Dropdown: (this loads the "Views" from the list in the Viewbag and firing the event works fine) @{ var viewHtmls = new Dictionary