【发布时间】:2009-06-16 05:32:49
【问题描述】:
我在我的 JSF portlet 中使用 AJAX。当会话到期时,我们假设会收到以下消息(这是会话到期时 AJAX 请求的响应)
此页面用于在您获得请求授权期间保存您的数据。
You will be forwarded to continue the authorization process. If this does not happen automatically, please click the Continue button below.
<CONTINUE BUTTON>
在 IE 6 和 7 中,我可以看到继续按钮。但在 Firefox 中,我看不到那个按钮。只有文本可见。但在源代码中我可以看到该部分,但在 Firebug 中它是灰色的。我已将屏幕截图上传到http://img31.imageshack.us/img31/619/firefoxcontinue.jpg 理想情况下,它应该自动将用户转发到登录页面,因为 AJAX 无法重定向,它只显示响应。因此,必须在 portlet 中显示继续按钮。谁能告诉我为什么 Mozilla Firefox 中没有显示 HTML 表单。
谢谢
我创建了一个测试页面。当我们尝试在表格中插入表单时,问题就出现了。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script type="text/javascript">
function insertAjax(){
// alert('inside ajax');
document.getElementById("wpsportlet").innerHTML='This page is used to hold your data while you are being authorized for your request.<br/><br/>You will be forwarded to continue the authorization process. If this does not happen automatically, please click the Continue button below.<form action="http://www.google.com" method="get" name="AUTOSUBMIT"><input type="submit" value="Continue"/></form>';
}
</script>
<input type=button value="Submit" onclick="insertAjax();">
<div id="wpsportlet">
</div>
</BODY>
</HTML>
如果我将表单嵌套在表格中,则表单不会在 Firefox 中显示。有人可以帮忙解决这个问题吗?
【问题讨论】: