Ajax 在 href 链接上重新加载整个页面

发布于 2024-11-14 21:48:41 字数 666 浏览 7 评论 0原文

我有一个用 ajax 构建的网站。它有英语和法语两个版本。英语位于 /public_html,法语位于 /public_html/fr。

Ajax 仅重新加载中间框架,而不重新加载页眉或页脚。因此,当我单击法语页面的链接时,它会显示在中间,但页眉和页脚仍然来自英语页面。

所以,当我点击链接时,基本上一个“#”不知从何而来:例如。 http://www.mysite.com /index.html#http://www.mysite.com/fr/index.html

英语到法语:

<li class="contact"><a href="/fr/index.html">French Version</a></li>

法语到英语:

<li class="contact"><a href="/index.html">English Version</a></li>

我需要单击时重新加载整个页面。我应该怎么办?

谢谢!

I have a website built in ajax. It has both English and French versions. English is at /public_html and french in /public_html/fr.

Ajax is only reloading the middle frame and not the header or footer. So, when I click the link to the French page, it shows it in the middle, but the header and footer are still from the English page.

So, basically a "#" is coming from nowhere when I click the link: eg. http://www.mysite.com/index.html#http://www.mysite.com/fr/index.html

English to French:

<li class="contact"><a href="/fr/index.html">French Version</a></li>

French to English:

<li class="contact"><a href="/index.html">English Version</a></li>

I need that, on click, the entire page is reloaded. What should I do?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花想c 2024-11-21 21:48:41

我来一刺。听起来您正在描述一个中间带有非 ajax 超链接的框架站点。该链接正在“刷新”中间框架,因为那是链接所在的位置。您可以向锚标记添加一个 target 来告诉它重新加载整个页面。

<a href="/fr/index.html" target="_top">French Version</a>

PS:当您执行此操作时,请不要忘记本地化“法语版本”一词(Version française?:-)

I'll take a stab. It sounds like you're describing a framed site with a non-ajax hyperlink in the middle of it. The link is "refreshing" the middle frame because that's where the link is. You can add a target to the anchor tag to tell it to reload the whole page.

<a href="/fr/index.html" target="_top">French Version</a>

PS While you're at it, don't forget to localize the words "French Version" (Version française? :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文