javascript - redirect_to out of an iframe - Stack Overflow

i have a rails app which has a form that renders in an iframe, and from the create action i would like

i have a rails app which has a form that renders in an iframe, and from the create action i would like to redirect_to out of the iframe and re-render the whole page rather than in the iframe.

i was curious what ideas are out there to acplish this.

i have a rails app which has a form that renders in an iframe, and from the create action i would like to redirect_to out of the iframe and re-render the whole page rather than in the iframe.

i was curious what ideas are out there to acplish this.

Share Improve this question asked Dec 1, 2010 at 4:47 brewsterbrewster 4,5028 gold badges49 silver badges72 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

You can do it! you have to replace the redirect_to with:

render :text => "<script>parent.location.href='/cms';</script>"

I'm pretty sure that the redirect_to method won't be able to be aware of the iframe you're in and will instead have to be done through some javascript

You might be able to submit your form, via javascript, to the parent window by serializing the form fields.

window.location.reload() after submitting your form via AJAX?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745603298a4635528.html

相关推荐

  • javascript - redirect_to out of an iframe - Stack Overflow

    i have a rails app which has a form that renders in an iframe, and from the create action i would like

    15小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信