1

我想知道使用 HTML 是否可以在没有 Ajax 和/或 JavaScript 的情况下创建异步请求?我不知道是否存在其他方法来避免整页重新加载?

4

4 回答 4

1

要以任何方式与服务器通信,不,恐怕你需要 Javascript

于 2012-07-03T09:26:14.307 回答
1

iframe 允许您这样做。

<a href="foo" target="iframe_name">linky</a>

规格

于 2012-07-03T09:26:53.240 回答
0

为避免整个页面重新加载,您可以使用框架或 iframe 以及针对这些 (i) 框架的链接。

<a href=somehref target=myiframe>my link</a>
<iframe name=myiframe></iframe>

但是,如果您根本不使用 javascript,您将很快受到限制。

于 2012-07-03T09:28:04.947 回答
0

<frame>您可以使用( MDN docu ) 和<iframe>( MDN docu )以某种方式模拟 AJAX 行为。

You can then specify the target attribute of <a> links to result in a request within the (i)frame with the respective ID (MDN docu).

This technique, however, is more or less abandoned in favor of using the usual JavaScript AJAX requests.

于 2012-07-03T09:29:42.250 回答