如何获取“somepage.php#name"中散列后的值? [英] How to get the value after the hash in "somepage.php#name"?

查看:31
本文介绍了如何获取“somepage.php#name"中散列后的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于给定的 url,我想从数据库中获取 name-after-hash 的年龄.所以对于像 thepage.php#Madonna 这样的 url,你会看到119!".

For a given url, I want to get the name-after-hash's age from the database. so for url like thepage.php#Madonna, you'll see "119!".

如何提取 url 中散列后的值?(我需要一种安全的全浏览器兼容的非 JAVASCRIPT 方式).我想像 $_GET['after hash'] 那样做.

How can I extract the value after the hash in a url? (i need a safe all-browser-compatible-NON-JAVASCRIPT way). I want to do that like $_GET['after hash'].

我不使用 GET 的原因是因为我想使用 AJAX 和 jquery 的历史插件.

The reason I'm not using GET is because I want to use AJAX and jquery's history plugin.

基本上我想要的是使用ajax根据散列后分配的值从服务器检索数据.

Basically what i want is to use ajax to retrieve data from the server according to the value assigned after the hash.

推荐答案

我认为这不可能.# 后面的字符串被浏览器解释为当前页面中的锚点名称.它不会传递给服务器.

I don't think it's possible. The string after # is interpreted by the browser as an anchor name within the current page. It is not passed to the server.

这篇关于如何获取“somepage.php#name"中散列后的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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