服务器端刷新发起的Ajax调用 [英] Server Side Reload Initiation on Ajax Call

查看:119
本文介绍了服务器端刷新发起的Ajax调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要开始从服务器端(PHP)durring和AJAX调用重载。如何做到这一点。老实说,我不认为这是支持的。

I need to initiate a reload from the server side(PHP) durring and AJAX call. How do I do this. I honestly don't think it is supported.

我目前的方法是使用PHP header()函数并捕捉它的responseText从AJAX调用,然后做一个innerHTML的补充。

My current method is to use the PHP header() function and capture it as responseText from the AJAX call and then do an innerHTML add.

然而,它是不是一个合适的重载在我的书,因为它DOEN不intiate在onload功能。这似乎也被做作,而不是一个干净的解决方案。

However it is not a proper reload in my book as it doen not intiate the onload function. It also seems to to be contrived and not a "clean" solution.

推荐答案

发送命令/标志回到你的Ajax处理,使其拨打页面下面的JavaScript方法:

Send a command/flag back to your Ajax handler to make it call the following JavaScript method in the page:

window.location.reload();

这篇关于服务器端刷新发起的Ajax调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆