javascript - $.ajax ReferenceError: data is not defined -


i getting

referenceerror: data not defined and

>networkerror: 500 internal server error - http://localhost/webapplication2/js/test.aspx" 

but aspx page in right directory

i did these remove internal server error :

http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm

code per tutorial

index.html (callback data posted here)

<body>     <input id="button" type="submit" value="go" />     <div id="feedback">    </div>   </body> 


this ajax method :

$('#button').click(function () {     $.ajax({         type: "post",         url: "test.aspx",         data: {"name=" + name},         success: function (data) {             $("#feedback").html(data);         }     }); }); 

test.aspx

<form id="form1" runat="server"> <div> <%response.write(request.form["name"].tostring()); %> </div> </form> 

similar posts :

ajax , “uncaught referenceerror: data not defined”
$.ajax() , "uncaught referenceerror: data not defined"
ajax data - uncaught referenceerror: date not defined

edit : jslint /jshint /sharplinter still not helping detecting syntax error .i need suggestion syntax check

there issue of placing datatype parameter too.. not in case .

i not able find simple there..please suggest

i guess, should pass data as:

data: {name: name}, 

also, instead of data, try use other variable in success function:

success: function (response) {    $("#feedback").html(response); } 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -