0

I have a ruby-on-rails application, which shows a modal dialog form for first-time users. However, if users close the dialog, I want to redirect the user to home page. How do I do that? Here's my JQuery snippet. Thanks.

this.dialog(
    {
        modal:true, 
        width:'auto',
        height:'auto',
        title: 'New to Purchest? Subscribe to deals that interest you!'

        close: function(event, ui) {  }
    }
)
manji
  • 47,442
  • 5
  • 96
  • 103
rookieRailer
  • 2,313
  • 2
  • 28
  • 48

1 Answers1

4

I think it's as simple as adding code to that close callback:

this.dialog(
{
    modal:true, 
    width:'auto',
    height:'auto',
    title: 'New to Purchest? Subscribe to deals that interest you!'

    close: function(event, ui) {
        top.location.href = 'http://www.wheredoyouwanttogotoday.com';
        // ^^ obscure microsoft marketing reference
    }
});
Jimmy Sawczuk
  • 13,488
  • 7
  • 46
  • 60