Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript中的poupup窗口和显示内容_Javascript_Jquery_Html_Spring_Spring Mvc - Fatal编程技术网

javascript中的poupup窗口和显示内容

javascript中的poupup窗口和显示内容,javascript,jquery,html,spring,spring-mvc,Javascript,Jquery,Html,Spring,Spring Mvc,我需要一个带有登录名、密码和提交按钮的弹出窗口。我用javascript创建了一个弹出窗口,如下所示。我可以打印警报,但文本文件和提交按钮不会显示在弹出窗口中 loginQB = function(){ window.open('about:blank', 'popup', 'width=640,height=580,resizeable,scrollbars'); document.getElementById('myAnchor').outerHTML=document.wr

我需要一个带有登录名、密码和提交按钮的弹出窗口。我用javascript创建了一个弹出窗口,如下所示。我可以打印警报,但文本文件和提交按钮不会显示在弹出窗口中

loginQB = function(){
    window.open('about:blank', 'popup', 'width=640,height=580,resizeable,scrollbars');
    document.getElementById('myAnchor').outerHTML=document.write("<input type=\"submit\" value=\"Submit\">");
    alert(document.documentElement.innerHTML)

}
loginQB=function(){
打开('about:blank','popup','width=640,height=580,可调整大小,滚动条');
document.getElementById('myAnchor').outerHTML=document.write(“”);
警报(document.documentElement.innerHTML)
}
html代码:

<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<form:form method="POST" action="/asi/mappings" onsubmit="loginQB(); return false;">

更新

   var win = window.open('about:blank', 'popup', 'width=640,height=580,resizeable,scrollbars');
        win.document.write('<form:form id="qblogin" method="POST" action="/asi/mappings">');
        win.document.write('<br>Sign in with mycompany Account or <a href="www.mycompany.com">CreateOne');
        win.document.write('<br><input type="text" name="userName">');
        win.document.write('<br><input type="password" name="password">');
        win.document.write('<br><input type="submit" value="Submit">');
        win.document.write('</form>'); 
var-win=window.open('about:blank','popup','width=640,height=580,可调整大小,滚动条');
win.document.write(“”);
win.document.write(“
使用mycompany帐户或CreateOne登录”); win.document.write(“
”); win.document.write(“
”); win.document.write(“
”); win.document.write(“”);

我变得不确定尝试使用变量访问窗口

var win = window.open('url', 'popup', 'width=640,height=580,resizeable,scrollbars');
win.document.write('<input type="submit" value="Submit">');
var-win=window.open('url','popup','width=640,height=580,可调整大小,滚动条');
win.document.write(“”);

我不确定您是否希望这样登录,在页面中使用模式窗口更为常见。

您没有终止您的

为什么不使用jQuery对话框而不是弹出窗口?
文档。write()
不做您认为的事情,它只是清除页面中的所有内容,只剩下它编写的输入。这发生在主页面上,而不是弹出窗口中。你的html被破坏了<代码>
不是有效的标记

是一个单例/单例标记。它只能是


(xhtml),为什么要在html上使用名称空间<代码>有效,更新了上面的问题,在弹出窗口中有表单提交问题。谢谢,现在更新代码。成功了。但是带有自定义标记库的表单操作不会执行操作。