开发者

question about how to render html

I have a form which contains : textbox1, btn1, Content(div) .

the Content div contains the Comments which existed in the db in a table called Comments . and I use the ajax with jquery to insert data to the db, my question is how to add the comment to the top of the div without reload the whole page . example : facebook 开发者_运维技巧comments , stackoverflow comments .


Use AJAX the other way around. Ask for the comments by some PHP script that does a query in your sql. Put the comment in your div by jquery:

$('div.content').html(resultFromAjax);


As with all Ajax, I recommend JQuery. JQuery's html function does exactly what you're looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜