如何在每个网页的地址栏中保留相同的网址? [英] How can I keep the same url in the address bar for every page?

查看:113
本文介绍了如何在每个网页的地址栏中保留相同的网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Codeigniter构建的网站,其中有很多页面和目录。



我们假设网站名称是 www.example .com (这是索引页)。
如果用户转到另一个页面,例如点击关于链接,如何在所有页面的地址栏中更改网站名称​​

解决方案

这是一个不好的主意如果没有其他,那么它阻止用户能够为您的网站添加书签。



有两种方法可以做到这一点,但是,如果你是在这个方向(我真的建议你现在回来,太晚了)。您可以在iframe中加载所有内容:

 <! - 您的网站可能看起来像这样 - > 
< html>
< body>< iframe src =http://path.to.your.real.site/>
< / html>

src属性将指向其他实际上具有所有动态URL的URL。 / p>

您的其他选项是AJAX。对于一个例子来说,这太长而复杂了。


I have a site built with Codeigniter where there are a lot of pages and directories.

Let's say the site name is www.example.com (this is the index page). If the user goes to another page, for example clicking on the "about" link, how can I make the site name not change in the address bar for all pages?

解决方案

That is a bad idea if for nothing else then that it prevents users from being able to bookmark your site.

There are two ways to do this, however, if you are intent on this direction (and I really do suggest that you turn back now before it is too late). You can load everything in an iframe:

<!-- your site might look like this then -->
<html>
   <body><iframe src="http://path.to.your.real.site" />
</html>

And the src property would be directing to some other URL which actually has all of the dynamic URL's.

Your other option is AJAX. That is really too long and complicated for an example though.

这篇关于如何在每个网页的地址栏中保留相同的网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆