fragment-identifier

How to run a JavaScript function when the user is visiting an hash link (#something) using JQuery?

左心房为你撑大大i 提交于 2019-12-08 01:30:26
I have a webb application at http://example.com/app and I would like to show a form if the user is visiting http://example/app#add-item . Is there any way I can use a jQuery script to add this functionallity? My current jQuery script already has a structure like this: $(document).ready( function() { $('#search').keyup( function() { ... } ); } ) How can I show a form using someting like this: $(document).ready( function() { $('#search').keyup( function() { ... } ); $('#add-item').visit( // .visit probably doesn't exist function() { content.innerHTML = myForm; } ); } ) Here is something I do:

How to detect Fragment identifiers in Url Mappings?

爷,独闯天下 提交于 2019-12-07 11:55:17
问题 In a Grails project I'm trying to map a Url based on whether or not a Fragment Identifier is present in the Url. The Fragment Identifiers are important because a Flash library SWFAddress uses them to communicate to a Flash application present in the web page. I simply need to determine whether a fragment is present or not in the Request url. Should I look into HttpServletRequest to do this? What's the best way in Grails to route a url based on whether a Fragment Identifier is present in a Url

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

我的未来我决定 提交于 2019-12-07 07:58:35
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 with my initial request URL, or do I need to resort to a JavaScript based solution on my end? Hans Z.

Keeping URL Fragments when redirecting in Internet Explorer

雨燕双飞 提交于 2019-12-06 07:59:10
问题 I'm currently facing a challenge with URL fragments in a single page application. When logging in the user will be redirected through Struts to a url containing a URL fragment / Hash / Anchor - part. <action name="LoginAction" class="de.my.stuff.LoginAction"> <interceptor-ref name="myStack" /> <result name="error"> <param name="location">/jsp/login.jsp</param> <param name="anchor">${hash}</param> </result> <result name="success" type="redirectAction"> <param name="actionName"

Stop loading of images on a hashchange event via JavaScript or jQuery

大憨熊 提交于 2019-12-06 02:47:50
问题 I am using the jQuery BBQ: Back Button & Query Library plugin to create a page that pulls in dynamic content when a link is clicked. When the link is clicked the hash is changed and new content is pulled in (the 'default' action of clicking a href is therefore disabled.) That part works just fine, but there is a problem. Example of my problem Say the "home" page has a DIV a number of images in it and a list of links ... Page One Page Two Page Three The images may take a while to load, in the

How to detect Fragment identifiers in Url Mappings?

时光毁灭记忆、已成空白 提交于 2019-12-05 18:29:15
In a Grails project I'm trying to map a Url based on whether or not a Fragment Identifier is present in the Url. The Fragment Identifiers are important because a Flash library SWFAddress uses them to communicate to a Flash application present in the web page. I simply need to determine whether a fragment is present or not in the Request url. Should I look into HttpServletRequest to do this? What's the best way in Grails to route a url based on whether a Fragment Identifier is present in a Url? [I asked this same question at the Grails forum .] A fragment identifier is not part of a URL, it is

prevent window.onhashchange from executing when hash is set via JavaScript

泪湿孤枕 提交于 2019-12-05 11:28:07
I use the window.onhashchange function to execute code when the User changes the hash of the page: window.onhashchange = function() { /* do something */ }; In some functions I also set the hash via JavaScript: window.location.hash = "#abc"; I want to prevent the onhashchange event from firing when I set the hash via JavaScript. What I have tried so far: var currently_setting_hash = false; window.onhashchange = function() { if (currently_setting_hash) return; //... } currently_setting_hash = true; window.location.hash = "#abc"; currently_setting_hash = false; That didn't work because the event

Keeping URL Fragments when redirecting in Internet Explorer

亡梦爱人 提交于 2019-12-04 13:16:40
I'm currently facing a challenge with URL fragments in a single page application. When logging in the user will be redirected through Struts to a url containing a URL fragment / Hash / Anchor - part. <action name="LoginAction" class="de.my.stuff.LoginAction"> <interceptor-ref name="myStack" /> <result name="error"> <param name="location">/jsp/login.jsp</param> <param name="anchor">${hash}</param> </result> <result name="success" type="redirectAction"> <param name="actionName">LoginSuccessAction</param> <param name="anchor">${hash}</param> </result> </action> As you can see the URL fragment is

Stop loading of images on a hashchange event via JavaScript or jQuery

北城余情 提交于 2019-12-04 09:26:26
I am using the jQuery BBQ: Back Button & Query Library plugin to create a page that pulls in dynamic content when a link is clicked. When the link is clicked the hash is changed and new content is pulled in (the 'default' action of clicking a href is therefore disabled.) That part works just fine, but there is a problem. Example of my problem Say the "home" page has a DIV a number of images in it and a list of links ... Page One Page Two Page Three The images may take a while to load, in the meantime the user will often not wait for them to load fully and click the "Page One" link. This clears

Multiple fragment identifiers correct in URL?

血红的双手。 提交于 2019-12-04 03:13:12
问题 I stumbled across a site that uses multiple fragment identifiers in their URLs, like http://www.ejeby.se/#newprodukt#produkt#1075#1 (no, it is not my site, but I am linking to it, which brings problems for me). But is this really correct? It does seem to cause problems for Safari and possibly also Internet Explorer (hearsay, I have not tried IE myself). Isn't the fragment identifier supposed to uniquely identify one location in the document? Is this a bug in Safari or is it www.ejeby.se that