且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从CodeIgniter中的URL捕获散列(#)

更新时间:2023-02-23 10:18:06


在代码点火器
允许hashbang和#123456
(或甚至只是123456)传递到
视图函数?

Is there anyway to in code igniter allow the hashbang and have #123456 (or even just 123456) passed to the view function?

缺少javascript,没有。浏览器根本不会将URL的fragment部分发送到服务器。 PHP只能读取它,如果JavaScript运行后页面已渲染发送它在第二个请求。

Short of javascript, no. The browser simply doesn't send the 'fragment' portion of the URL to the server. PHP can only read it if javascript running after the page has rendered sends it in a second request.