创建页面的模式窗口加载以用于用户反馈

Creating a modal window onload of a page for user feedback

本文关键字:加载 用于 用户反馈 窗口 模式 创建      更新时间:2023-09-26

我必须创建一个模态窗口来显示弹出窗口或模态窗口,以获取用户对我们内部网的反馈。此窗口应该有一个复选框,上面写着"不要再问这个问题"。我尝试使用 jquery 创建此窗口,但我不知道该怎么做。我什至试图谷歌它,但没有得到正确的答案。谁能帮我解决这个问题。我是jquery的新手。我见过许多网站,他们创建了模态窗口,但他们使用 php,而我不能。请帮助我使用jquery,jsp或javascript代码来实现此目的。附上用例文档的屏幕截图。任何帮助,不胜感激。提前谢谢。附言我正在使用网络门户。

对不起,图像不允许。.

下面提到的代码也不起作用。请帮忙。

    <html>
<head>
<%@page session="false" contentType="text/html" pageEncoding="ISO-8859-1" import="java.util.*,javax.portlet.*,com.ibm.accessitservicesfeedbackpopup.*" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>        
<%@taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model" prefix="portlet-client-model" %>        
<portlet:defineObjects/>
<link rel="stylesheet" type="text/css" href="<%= renderRequest.getContextPath() %>/style.css"/>
<link rel="stylesheet" type="text/css" href="<%= renderRequest.getContextPath() %>/jqModal.css"/>
<script language="javascript" type="text/javascript" src="<%= renderRequest.getContextPath() %>/jqModal.js"></script>
<script language="javascript" type="text/javascript">
function confirm(msg,callback) {
  $('#confirm')
    .jqmShow()
    .find('p.jqmConfirmMsg')
      .html(msg)
    .end()
    .find(':submit:visible')
      .click(function(){
        if(this.value == 'yes')
          (typeof callback == 'string') ?
            window.location.href = callback :
            callback();
        $('#confirm').jqmHide();
      });
}

$().ready(function() {
  $('#confirm').jqm({overlay: 88, modal: true, trigger: false});
  // trigger a confirm whenever links of class alert are pressed.
  $('a.confirm').click(function() { 
    confirm('About to visit: '+this.href+' !',this.href); 
    return false;
  });
});
</script>
</head>
<body>
<a href="#" class="jqModal">view</a> (confirm)
<!-- Confirm Dialog -->
<div class="jqmWindow" id="confirm">
<div id="ex3b" class="jqmConfirmWindow">
    <div class="jqmConfirmTitle clearfix">
    <a href="#" class="jqmClose"><em>Close</em></a>
  </div>
  <div class="jqmConfirmContent">
  <p class="jqmConfirmMsg"></p>
  <p>Continue?</p>
  </div>
  <input type="submit" value="no" />
  <input type="submit" value="yes" />
</div>
</div>
</body>
</html> 
您可以使用很好的

jQuery对话框。只需下载jQuery和jquery ui(js和css)并包含在您的项目中。它非常有效。