当iframe在该表单内时,表单提交到iframe

时间:2015-05-14 16:31:42

标签: javascript html iframe

我发现formiframe内定义iframeform提交<form id="form_role"> <iframe id="iframe_role" name="iframe_role"> </iframe> </form> 有趣的事情。

form_role

我将iframe_role提交给document.getElementById("form_role").method = "post"; document.getElementById("form_role").action = "ABC.jsp"; document.getElementById("form_role").target = "iframe_role"; document.getElementById("form_role").submit();

ABC.jsp

在Chrome中,iframe加载但没有iframe;即我丢失了ABC.jsp

在IE&amp; Opera,iframe加载<iframe id="iframe_role" name="iframe_role"> </iframe> <form id="form_role"> </form>

这种情况下的标准是什么?谁是正确的规格:Chrome或IE / Opera?

如果我将iframe排除在外:

ABC.jsp

然后iframe加载到Chrome,IE和Opera中的Imports Microsoft.SqlServer.TransactSql.ScriptDom Module Module1 Sub Main() Dim fragment As TSqlFragment Dim parser As New TSql120Parser(True) Dim reader As System.IO.StreamReader Dim errors As IList(Of ParseError) reader = IO.File.OpenText("script.sql") fragment = parser.Parse(reader, errors) Dim foundIn As Boolean = False Dim foundView As Boolean = False Dim viewName As String = "" For Each tkn As TSqlParserToken In fragment.ScriptTokenStream If tkn.TokenType = TSqlTokenType.View Then foundView = True End If If tkn.TokenType = TSqlTokenType.In Then foundIn = True End If 'Once you see a View, take everything until you see an As If foundView = True And tkn.TokenType = TSqlTokenType.As Then Console.WriteLine(viewName.Trim) viewName = "" foundView = False ElseIf foundView = True Then viewName += tkn.Text End If 'Once you see an IN, collect the ASCII elements until a right parentheses is encountered. If tkn.TokenType = TSqlTokenType.AsciiStringLiteral And foundIn = True Then Console.WriteLine(tkn.Text) ElseIf tkn.TokenType = TSqlTokenType.RightParenthesis And foundIn = True Then 'end of the IN condition foundIn = False End If Next Console.ReadKey() End Sub End Module

1 个答案:

答案 0 :(得分:0)

iframe中有form似乎有点难看。我认为在这种情况下不存在类似标准的东西。您已经自己回答了问题:

<iframe id="iframe_role" name="iframe_role">
</iframe>
<form id="form_role">
</form>

是纯粹的 HTML