0

I have content in a modalized window, and when a user clicks a link, I'd like to have the entire browser redirect, not just the modal window. This doesn't work, unfortunately.

Code I currently have:

<a onclick="window.location.href = 'http://insert/url/here'">morestuff!</a>

This only loads the url in the modal window. What can I do to get the whole window to load said url?

Community
  • 1
  • 1
SomeKittens
  • 38,868
  • 19
  • 114
  • 143

2 Answers2

1

Something like this should work:

<a onclick="window.parent.location.href='http://insert/url/here'">morestuff!</a>
Robin
  • 495
  • 1
  • 5
  • 18
0

When you say "modalized" - do you mean a jquery dialog/IFrame window or a physically different browser window.

If it's the first case then you need a reference to the outer parent:

window.parent.location.href = "http://www...";

If it's the second one then you need a reference to the opener:

window.opener.location.href = "http://www...";

web_bod
  • 5,728
  • 1
  • 17
  • 25