fragment-identifier

How to get the URL fragment identifier from HttpServletRequest

隐身守侯 提交于 2019-12-17 07:37:56
问题 How do I get the URL fragment identifier from HttpServletRequest ? The javadocs doesn't seem to mention it. 回答1: You can't get the URL fragment in the way you'd like. Typically, the browser doesn't send the fragment to the server. This can be verified by using a network protocol analyser like tcpdump, Ethereal, Wireshark, Charles. However, you can send the fragment string as a GET/POST parameter on a JavaScript request. To get the value using JavaScript, use window.location.hash . You can

How does facebook rewrite the source URL of a page in the browser address bar?

吃可爱长大的小学妹 提交于 2019-12-17 03:23:30
问题 Go to http://www.facebook.com/facebook?v=wall, then click on the info tab. The content will be loaded, and the address bar now becomes http://www.facebook.com/facebook?v=info but the webpage didn't reload. At first I think it is Ajax, but my question is, how do you change the address bar without reloading? I know I can change anchor (#wall) using JS but querystring (?v=wall), how? 回答1: It's using HTML5's new history.pushState() feature to allow the page to masquerade as being at a different

Conflict of displayDialogAsync and html5-history-api

ぐ巨炮叔叔 提交于 2019-12-13 17:11:36
问题 I have an application by mean-stack that hosts a website and an Excel add-in. html5 is enabled, and it has <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script src="https://cdn.rawgit.com/devote/HTML5-History-API/master/history.js"></script> In the Excel add-in, I have a button that opens a page in the website by Dialog API: $scope.openDialog = function () { Office.context.ui.displayDialogAsync("https://localhost:3000/preview/tmp/6wr-4PqdBrYQwjp3AAAD", {}

301 Redirect without fragment [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-13 04:09:56
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: URL Fragment and 302 redirects I need to help regarding the 301 Redirect without Special character. For example, I want to redirect the following URL: http://www.iphoneapplications.us/iphone-ipad-mobile-apps-portfolio.html#Gigguid To the following URL: http://www.i-phonedeveloper.com/portfolio.html I have changed .htaccess to perform the redirect, but the fragment #Gigguid remains in the final URL. How can this

Fragment link not working

穿精又带淫゛_ 提交于 2019-12-11 08:43:30
问题 Total newbie question, but I cant figure out what im doing wrong. I want a make a link that jumps down the page to a header. I believe these are called fragment links. Here is my code thats not working: <a href="#Frag">My Link</a> <div id="cont"> <p>Lots of content here, abbreviated in this example to save space</p> <h2 id="Frag">Header I want to jump to</h2> </div> 回答1: Your code works fine in firefox anyway you can use as well name instead of id.. http://www.w3schools.com/tags/att_a_name

URL fragments and the BASE tag

老子叫甜甜 提交于 2019-12-11 00:43:58
问题 I'm using the <base> tag in an application to simplify development. I'm aware of the " feature " that occurs when an anchor is only a URL fragment, as in it routes to the <base> URL + fragment. What can I do to circumvent that? I've never fudged with window.location or anything in Javascript, and rather than hack around for awhile at it, I assume someone knows of a quick-and-dirty, or an example. Can this be circumvented? If so, please advise. ( I hate asking questions that suggest no attempt

Why urllib2.urlopen can not open pages like “http://localhost/new-post#comment-29”?

人盡茶涼 提交于 2019-12-10 10:29:32
问题 I'm curious, how come I get 404 error running this line: urllib2.urlopen("http://localhost/new-post#comment-29") While everything works fine surfing http://localhost/new-post#comment-29 in any browser... urlopen method does not parse urls with "#" in it? Anybody knows? 回答1: In the HTTP protocol, the fragment (from # onwards) is not sent to the server across the network: it's locally retained by the browser and used, once the server's response is fully received, to somehow "visually locate"

How do I use jQuery to create a bookmark-able hash?

放肆的年华 提交于 2019-12-10 07:44:09
问题 I have a single URL I am using as an image gallery. At this URL is a thumbs div (I'm only showing four thumbs for the sake of brevity): <div id="thumbs"> <img src="graphics/thumbs/01.jpg" width="190" height="190" class="thumb objects" id="project01" /> <img src="graphics/thumbs/08.jpg" width="190" height="190" class="thumb web" id="project08" /> <img src="graphics/thumbs/14.jpg" width="190" height="190" class="thumb freehand" id="project14"/> <img src="graphics/thumbs/04.jpg" width="190"

Apache rewrite rule for a destination containing a hash mark

人盡茶涼 提交于 2019-12-09 14:14:21
问题 I'm trying to issue a redirect where the destination contains a fragment-identifier part. I tried with this rule: RewriteRule ^/foo/bar/([^/]+)/(.*)$ /cgi/script#foobar::$1.$2 [R,L] However the # is converted into %23 and the web application cannot correctly parse this url. How can I force apache to keep the # character ? 回答1: Solution found: there is an option for not escaping urls with mod_rewrite: https://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_ne Adding the [NE] flag solved the

Google OAuth service redirects to URL with a # sign at the end

我只是一个虾纸丫 提交于 2019-12-08 08:27:02
问题 When the user is redirected to https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[clientid]&redirect_uri=http://example.com/googleauth&scope=email by our "Sign In with Google" button, the response's Location header that causes the redirection back to the site has a # symbol at the end: Response headers: location: http://example.com/googleauth?code=[code]# It certainly does not break the site's funcionality, but I'd like to get rid of it anyway. Is there something wrong