XPages:获取-this._partialRefresh AJAX调用的内容? [英] XPages: Get the contents of a - this._partialRefresh AJAX call?
问题描述
我正在对XPage(Domino 8.5.1)进行部分刷新,但是需要获取响应的内容.
I'm doing a partialrefresh of an XPage (Domino 8.5.1) but need to get the contents of the response.
原因是IE8有时(有时)由于未显示部分刷新的HTML而出现问题.我可以看到响应是正确的,但是DOM没有更新.
The reason is that IE8 seems to (sometimes) have an issue with partial refreshed HTML not showing. I can see that the response is correct but the DOM isn't updated.
有一个简单的解决方法:
There's an easy fix for this:
div.innerHTML = div.innerHTML
但是对于我来说,我需要内容,以便可以将其插入到第一位.
But for me to apply this I need the content so I can insert it in the first place.
那么,是否可以从partialRefresh获取返回的HTML?还是有另一种方法可以解决这个问题?
So, is it possible to get the returned HTML from a partialRefresh? Or is there another way to solve this?
推荐答案
要劫持部分刷新,可以添加以下CSJS代码:
To hijack a partial refresh you can add this CSJS code:
// --- hijack dojo XHR calls
dojo._xhr = dojo.xhr;
var loadOld;
function hijacked( response, ioArgs ){
alert( response ); // change code here to do whatever you want. //
loadOld( response, ioArgs ); // call the original function
}
dojo.xhr = function( mode, args, bool ){
loadOld = args["load"];
args["load"] = hijacked;
dojo._xhr( mode, args, bool );
}
只需更改劫持"功能即可满足您的要求.
Just change the function "hijacked" to fullify your requirements.
希望这会有所帮助
斯文
修改: 在对DOM进行更改之前(在OnComplete事件之前)执行劫持"方法
The method "hijacked" is executed BEFORE the changes to the DOM will be applied (and before OnComplete event)
这篇关于XPages:获取-this._partialRefresh AJAX调用的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!