javascript - Issues with jquery html() -
Receive data compromised with an element of a certain thing, with a simple answer everywhere on the Internet such a Does not cover the simple question. help please.
I manipulated an element with an AJAX request:
$ ("# last_comment_added"). Html ("1457856458")
Now enter
I get old data from element, new agax "14 57856458" data
please help.
Do not use eval.
Try
$ (Document) .ready (function () {var post_slug = $ ("# post_slug") .HTML (); var last_comment_added = $ ("# last_comment_added") Html (); if (post_slog & end_comment_ added) {set Inner (_update, 10000);}}); Function _update () {$ .ajax ({type: "POST", url: "ajax_comments.php", data: {"work": "update", "post_slog": post_slog, "last_com_add": last_comment_added}, cache: False, success: work (data) {$ ("# last_comment_ added"). Html (data)}}); }
and you return only from PHP to new data (like something: echo '1457856458';
)
Comments
Post a Comment