我有一个 HTML 表单,提交后会加载结果页面。
当我使用 anchor 标记链接到相同的结果页面时,我可以使用 rel="external"
或 data-ajax="false"
强制完整刷新页面并重新加载相关页面 CSS。
从提交中加载的页面是否有等效项?我目前没有使用 jQuery 提交表单。
注意:
除了 @peterm 的回答,我最初尝试没有成功,我在表单的操作字符串 (action="results.php?type=search"
) 中附加了一个参数,我将其移入表单中隐藏的输入元素:
<input type="hidden" name="type" value="search" />
完成此操作后,它对我来说非常有效。
最佳答案
您可以在 form
元素上使用 data-ajax="false"
。
To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.
关于表单提交后未加载 CSS - jQuery Mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14366964/