提交按钮在 IE 中不起作用
我在 html 中声明了一个 iFrame,源是我的 XQuery 文件。在我的 XQuery 中,我定义了一个
,其中我还声明了一个名为“convert”的按钮。我的XQuery文件基本上是这样的(这是iFrame的来源)
return
<div id="content">
<table>
....
<tbody>
{
...
<td>
<a id="{$t/@id}"
rel="nofollow"
target="_new"
name="{util:document-name($t)}:{util:node-id($t)}"
href=
"http://localhost:8080/exist/rest/db/motorola/xquery/toDita.xql?xml={
util:document-name($t)
}&xsl=mot2dita.xsl">
<input type="submit" value="convert"/>
</a>
</td>
...
}
</tbody>
</table>
</div>
正如你所看到的,在一个td中,我声明了一个名为“convert”的按钮,“href”给出了链接。现在这个按钮在Firefox 和 Chrome(打开一个新窗口来执行任务),但在 IE 中,单击它后,它什么也没做,
我想知道这是浏览器问题还是我的 XQuery 脚本有问题。出去。
I declared an iFrame in my html, and the source is my XQuery file. In my XQuery, I defined a <div>
, within which I also declared a button named "convert".
My XQuery file basically looks like this (this is the source for the iFrame)
return
<div id="content">
<table>
....
<tbody>
{
...
<td>
<a id="{$t/@id}"
rel="nofollow"
target="_new"
name="{util:document-name($t)}:{util:node-id($t)}"
href=
"http://localhost:8080/exist/rest/db/motorola/xquery/toDita.xql?xml={
util:document-name($t)
}&xsl=mot2dita.xsl">
<input type="submit" value="convert"/>
</a>
</td>
...
}
</tbody>
</table>
</div>
As you can see, in a td, I declared a button called "convert", and the "href" gives the link. Right now this button works perfectly in Firefox and Chrome(opening a new window to do the task), but in IE, after clicking it, it just doesn't do anything.
I wonder if this is a browser issue or my XQuery script has problems. Thanks in advance for helping out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
标记在
标记内无效。因此,XHTML 代码无效,这将导致不一致的行为 - 某些浏览器比其他浏览器更擅长补偿此类奇怪情况。
建议您完全删除
并使用 CSS 将您的
标记设置为看起来像按钮(如果您只是希望看到按钮的外观)正在追赶。
<input>
tags are not valid inside<a>
tags. The XHTML code is therefore not valid, which will account for the inconsistent behaviour - some browsers are better at compensating for odd cases like this than others.Recommend you remove the
<input>
entirely and use CSS to style your<a>
tag to look like a button, if it's just the look of a button that you're after.除非您在表单内,否则它不会提交任何内容......绝对不是 A 标记。
我更喜欢使用 Jquery UI 的按钮功能来完成这些操作。它获得您正在寻找的所需行为,并逐步增强和测试以处理所有浏览器,并且可以使用 href 链接、按钮元素或 input type=submit 元素来完成。另外,造型看起来很棒而且是即时的。
这是一个快速的提示:http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/
Unless you're inside a form, it's not going to submit anything...definitely not an A tag.
I prefer to do these with Jquery UI's button feature. It gets the desired behavior you're looking for, is progressively enhanced and tested to handle the full gamut of browsers, and can be done use a href links, button elements, or input type=submit elements. Plus, styling looks great and is instantaneous.
Here's a quick tut: http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/