To dynamically generate HTML I'm having trouble using AJAX to add < P> Thank you for the help I really appreciate it. Please tell me if there is any misunderstanding and I will make the ASAP clear. And I have click events that will add html for SPAN It seems that Anjing Ajax does not work in a call, but works out of it. Does anyone know why and how I will face this problem? Basically I have to develop the skills of the dynamic period (where I want to add data to use AJAX) This / Strong> jhxQR object You can refer to this Need to save And must use it in Ajax callback A better way to use Third Appraoch You can also pass the ## ### In the code where the main points are
$ (document) .ready (function () {// Sort default refresh var selected_skill = $ ('# Order'). (": Selected") search. Text (); sortbisk scale (selected_skill); ##### dynamic & lt; #### # problem ##### ("# feed "). But ('click', '.post', showform); ##### The problem is within this code, where I'm a & lt; span & gt; #####});
function showForm () {// Check that the user is logged into user name = $ ('# user name)'. Val (); Var form_id = "form_comment_" + this.id; Var comment_span = "comment_span_" + this.id; If ($ ("$" + form_id) .length == 0) {// All comments are already $ .ense ({type: "post", url: "ajaxcals.fp"), data: {fpost_id: it .id, xswitch: "SFC"}, data type: "json", error: function (qXHR, text position, error thrown) {console.log (errorThrown);}, success: function (result) {// display comment (Var i = 0; i & lt; result.length; i ++) for the console log (the result [0] .username) {var comments_html = result [i]. Username + ":" + result [i] .comment + "& lt; br & gt;"; $ ("# Span_post_" + this.id) .append (comments_html); // ##### Adding it ##### ("# span_post_" + this.id) .append ("Why does not it add?");}}}); $ ("# Span_post_" + this.id) .append ("This fix adds"); // ##### This appendix fin ##### and other {$ ("#" + comment_span) .remove (); // Remove the element if it already exists} return false; }
function SortBySkill (selected_skill) {$ .jax ({type: "POST", url: "ajax_calls.php", data: {skill: selected_skill, xswitch: "SBS"}, data type: "json", error: function (qXHR , Textstats, error trouvance) {console .log (errorThrown);}, success: function (results) {for (var i = 0; i & lt; result.length; i ++) {// ##### Dynamically generated duration ##### str_post = "
var self = this; // Save the reference // already $. Ajax ({... success: function () {// displays all comments used $ ("# span_post_" + self.id) .append (} < P> Second Approach
$ .proky to bind the context of implementing it
context parameter to Ajax
Data type: "Jason", Reference: This, // succeeded in the list of options Interpretation:
No comments:
Post a Comment