开发者

When a click on a link,the target page is just showed up when fully loaded

开发者 https://www.devze.com 2023-04-13 03:53 出处:网络
I have 2 php pages: A and B. Page A has a link for B. Page B has lot of functions (including jquery functions) and takes about 10 sec to fully load.

I have 2 php pages: A and B. Page A has a link for B.

Page B has lot of functions (including jquery functions) and takes about 10 sec to fully load.

The issue is:

When i click on page's A link, page B is just showed up when it's fully loaded. In this mean time page A keeps 'thinking'.

My intention is when I click on page's A link it instantly goes to page B, and on page B I use a javascript to show a "loading" gif animation until page it's not fully loaded.

Strange because it works properly on my localhost, but not on the server(linux). Maybe something on php.ini? (i've tried output_buffer=off, but it didn'开发者_如何学编程t work). Any suggestions?

thanks!!!


It's likely there's buffering going on on the server. Try calling ob_flush(), flush(), ob_flush(), flush(). Sometimes you need to call them multiple times, so I call them like that.

ob_flush() will flush any output buffer you have. flush() will flush any apache buffer, although some modules may still cause it to buffer.

It sounds like this is an environmental issue, not a code issue, so if you're still having errors I'd look and see what's different between the environments.


just found out

Just got in contact with my server help desk...My server does not allow output_buffer to be Off.even if it's set on php.ini.So no solutions

thanks all

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号