常用的 RJS 模板方法

page.replace_html 'elementId', 'Some text here.. or a partial like below'

page.replace_html 'elementId', :partial => 'element/edit'

page.remove 'elementId'

page.insert_html :before/:after/:top/:bottom, 'text or partial'

page.send :record, 'raw javascript' (Note: this is deprecated use <<)

page << 'rawJavascript();'

page.visual_effect :fade, 'elementId', :duration => 0.5

page.hide 'elementId1' [, 'elementId2', and more..]

page.show 'elementId1' [, 'elementId2', and more..]

你可能感兴趣的:(JavaScript,html)