修改后将DOM保存为HTML [英] Saving the DOM as HTML after modification
本文介绍了修改后将DOM保存为HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Rails应用程序中,我想使用javascript修改网页的DOM
In an Rails app I want to modify the DOM of a web page using javascript
我可以在每次修改后保存生成的HTML(整个页面)一个数据库?
Can I save the resulting HTML (of the whole page) after each modification to a database?
谢谢。
Thanks.
推荐答案
var html = $(document).html();
然后用 $。ajax()
到您选择保存的控制器。
With jQuery you could use var html = $(document).html();
Then post the html with $.ajax()
to the controller where you choose to save it.
这篇关于修改后将DOM保存为HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文