Ajax 在 href 链接上重新加载整个页面
我有一个用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我来一刺。听起来您正在描述一个中间带有非 ajax 超链接的框架站点。该链接正在“刷新”中间框架,因为那是链接所在的位置。您可以向锚标记添加一个
target
来告诉它重新加载整个页面。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.PS While you're at it, don't forget to localize the words "French Version" (Version française? :-)