Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax call keeps hitting the error function
    primarykey
    data
    text
    <p>I'm trying to set the title attribute for all elements in my page using bettertooltip.</p> <p>I'm getting info from a webmethod but the call keeps hitting the error function.</p> <p>My webmethod is used to extract some information from a sql server and Searialize it back to the ajax sucess function. What am I doing wrong?</p> <p><strong>here is my javascript:</strong></p> <pre><code>&lt;script&gt; $(document).ready(function () { var PrevIDs = $('a[alter="add_title"]'); //get all preview noded $.each(PrevIDs, function () { change_a_title(this); }); $('.tTip').betterTooltip({ speed: 150, delay: 300 }); }); function change_a_title(obj) { var value1 = obj.id; var dataString = JSON.stringify({ e_num: value1 }); $.ajax({ type: "POST", async: false, url: "test_for title.aspx/return_event_details", data: dataString, contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { //result is an Object() returned from the server, we can use it and get the data from it, result.d has the response data if (result.d) { debugger; var event = JSON.parse(result.d); // var Titles = [" ניסיון ", " מין ", " ימים ", " שעות "]; // var currentTitle = "&lt;table&gt;"; // for (var i = 0; i &lt; Grades.length; i++) { // debugger; // currentTitle += "&lt;tr&gt;&lt;td style='text-align:center'&gt;&lt;b&gt;" + Titles[i] + "&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;div class='progress_wrapper pink_blue'&gt;&lt;span class='pink_blue tooltip'&gt;" + Grades[i] + "%&lt;/span&gt;&lt;progress value='" + Grades[i] + "' max='100' class='pink_blue'&gt;&lt;/progress&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;"; // } // currentTitle += "&lt;/table&gt;" obj.title = event["name"]; } else { } }, error: function (result) { alert("Error Massage"); } }); // debugger; // obj.title = currentTitle; // obj.attr("title", currentTitle); } &lt;/script&gt; </code></pre> <p><strong>right now I check only for one elemnt: (it is sent to the "change_a_title" function but ajax call fail):</strong></p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;a id="1" alter="add_title"&gt;ווקוו&lt;/a&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p><strong>This is my method:</strong> </p> <pre><code> [WebMethod] public static string return_event_details(string e_num) { dbservices db = new dbservices(); act_event event1 = db.return_event_by_num(Convert.ToInt32(e_num)); JavaScriptSerializer jSearializer = new JavaScriptSerializer(); return jSearializer.Serialize(event1); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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