Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
34
rated 0 times [  41] [ 7]  / answers: 1 / hits: 31955  / 14 Years ago, wed, september 8, 2010, 12:00:00

For example if I type in the URL:



http://www.foo.com/page.php?parameter=kickme#MOREURL



Then on the server there is no part: #MOREURL



Is possible to send or get these part to the server without jQuery AJAX?.


More From » php

 Answers
10

No, it is available to the browser only, so you have to deal it with Javascript. The server can not read it.



Explanation:

Basically the hash component of the page URL (the part following the # sign) is processed by the browser only - the browser never passes it to the server. This sadly is part of the HTML standard and is the same whether or not you are using IE or any other browser (and for that matter PHP or any other server side technology).



Here's what Wikipedia says about it:




The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the server. When an agent (such as a Web browser) requests a resource from a Web server, the agent sends the URI to the server, but does not send the fragment. Instead, the agent waits for the server to send the resource, and then the agent processes the resource according to the fragment value. In the most common case, the agent scrolls a Web page down to the anchor element which has an attribute string equal to the fragment value. Other client behaviors are possible



[#95683] Friday, September 3, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
marisela

Total Points: 103
Total Questions: 105
Total Answers: 102

Location: Solomon Islands
Member since Fri, Oct 8, 2021
3 Years ago
;