我在 Firefox 中偶然发现了一个奇怪的行为。我有一个动态创建的文本,我在其中插入了一个包含链接的表单元素,以便能够通过 post 方法传递参数。理想情况下,它应该与文本一起流动,看起来像一个普通的锚。然而,尽管它在 IE 中正常显示,但 Firefox 会在表单之前终止该段落,这会插入一个不需要的换行符。有谁知道为什么会发生这种情况并有解决方法/替代解决方案?
IE 中的结果(好的):
<p class="article" >This is my paragraph and here goes my
<form style="display: inline" name="link_form" action="link.html" method="post">
<input type="hidden" name="lnk_id" value="1" /><a class="link" href="#" onclick="link_form.submit()">link</a></form>**</p>**
Firefox (ko) 中的结果:
<p class="article" >This is my paragraph and here goes my**</p>**
<form style="display: inline" name="link_form" action="link.html" method="post">
<input type="hidden" name="lnk_id" value="1" /><a class="link" href="#" onclick="link_form.submit()">link</a></form>
提前致谢