CodeIgniter Forums
window.parent.location.href = 'http://yoururl.com'; - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: window.parent.location.href = 'http://yoururl.com'; (/thread-8720.html)



window.parent.location.href = 'http://yoururl.com'; - El Forum - 05-28-2008

[eluser]new_igniter[/eluser]
I am using Nick Stakenburg's Lightview and need to close an iframe that is sitting in a lightbox above the page. His command is to use:
Code:
window.parent.location.href = 'http://yoururl.com';

How do I do such a thing in CI using the redirect function in a controller?


window.parent.location.href = 'http://yoururl.com'; - El Forum - 05-29-2008

[eluser]xwero[/eluser]
If you are talking about going to the landing page of the site using redirect just add an empty string.

If you are talking about closing the lightbox it is bad form to use location.href because the idea now is to use javascript to emulate desktop software UIs that don't reload their interface when changes are made. A better way to do it is to hide/remove the overlaying elements.


window.parent.location.href = 'http://yoururl.com'; - El Forum - 05-29-2008

[eluser]new_igniter[/eluser]
I need to refresh the page however.


window.parent.location.href = 'http://yoururl.com'; - El Forum - 05-29-2008

[eluser]xwero[/eluser]
Can't you use ajax to reflect the changes you made in the iframe?