Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Message":"Invalid web service call, missing value for parameter: \u0027haha\u0027
    text
    copied!<p>I'm a newbie in Jquery Ajax. I need your help. I want to display one text beside span element. I have already done reference some topics but i cant resolve it</p> <p>Here is my error in firebug (newlines and indentation added)</p> <blockquote> <pre><code>{"Message":"Invalid web service call, missing value for parameter: \u0027haha\u0027.", "StackTrace":" at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters) at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters) at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)", "ExceptionType":"System.InvalidOperationException"} </code></pre> </blockquote> <p>In aspx </p> <pre><code>&lt;asp:TextBox ID="txtNoiDung" runat="server" TextMode="MultiLine" CssClass="txtNoiDung"&gt;&lt;/asp:TextBox&gt;&lt;span id="vltxtNoiDung"&gt;&lt;/span&gt; </code></pre> <p>In code behind</p> <pre><code> [WebMethod()] public static string test1cai(string haha) { return haha; } </code></pre> <p>In Javascript</p> <pre><code>$(".txtNoiDung").focusout(function () { var dataToSend = { names: $(this).val() }; $.ajax({ type: "POST", url: "QuanLyTin.aspx/test1cai", data: JSON.stringify(dataToSend), contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { $("#vltxtNoiDung").text(msg.d) }, error: function (xhr, reason, ex) { alert(reason); } }); }); </code></pre> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload