Welcome Guest, Not a member yet? Register   Sign In
redirects in Internet Explorer
#1

[eluser]gscharlemann[/eluser]
has anyone experienced any issues using:
Code:
redirect('controller/function', 'refresh')
in Internet Explorer? Everything works as expected, but the page "hangs" for 2-3 seconds before loading. I don't experience this issue with Firefox or Chrome.

I tried changing the 'refresh' to 'location' as suggested in the User Guide (URL Helper), but that didn't help.

any suggestions on how to fix this or what might be causing it are greatly appreciated it.
#2

[eluser]slowgary[/eluser]
Internet Explorer is ALWAYS slower than the other guys Smile

I read on php.net that clients will sometimes wait until they receive the content-length header before redirecting. See if you can still send other headers after calling redirect()... something like:
Code:
header('Content-Length: 0',true);

Hope this helps.
#3

[eluser]Caio Russo[/eluser]
Hi, gscharlemann.

I have this issue with IE too, and used a javascript to redirect. Works faster:
Code:
echo '&lt; script &gt;location.href="page"< /script >';
it's a workaround, but, hey, it's IE ;-).

Cheers!

Caio Russo
#4

[eluser]gscharlemann[/eluser]
Cool. Thanks, I'll try these out. Any idea how this affects flashdata? I send a couple status messages via flashdata.
#5

[eluser]Caio Russo[/eluser]
[quote author="gscharlemann" date="1272439841"]Cool. Thanks, I'll try these out. Any idea how this affects flashdata? I send a couple status messages via flashdata.[/quote]

Well, I have some sessions on my code and they are not affected by the "js" redirect method at all. I think u will not have any problems.
#6

[eluser]gscharlemann[/eluser]
the javascript approach seems to work better than the header call after the redirect. Still not as fast as firefox though. thanks for your help.
#7

[eluser]gscharlemann[/eluser]
I've implemented the javascript approach suggested above with a little bit of improvement, but it's still hanging. I tried to insert a page load time calculation in my header and footer (that are embedded in the views), but I get an error. I'm using the page load calculator found here:
http://www.developertutorials.com/tutori...page1.html

My views are structured as so:
views/embeds/header.php
views/embeds/footer.php

In header.php, I put the first part of the code and footer.php I put the last part. When I load overview.php, which looks like:
Code:
&lt;?php $this->load->view('embeds/header.php')?&gt;
<div>
...
</div>
&lt;?php $this->load->view('embeds/footer.php')?&gt;

When I call the controller that loads the overview.php view, I get an error that starttime is an undefined variable. Why can't the footer.php file see a variable that is initialized in header.php?

Thanks
#8

[eluser]Caio Russo[/eluser]
Hi, gscharlemann

you must call the view directly from the controller:

Code:
function getList(){
   $this->load->view('embeds/header.php');
   $this->load->view('embeds/content.php');
   $this->load->view('embeds/footer.php');
}




Theme © iAndrew 2016 - Forum software by © MyBB