I have a Spring-MVC application with Freemarker as a view component.
My templates create several links that point to my application and which include URL parameters containing a hash key ( #).
Example:
: Q#106368 11
URL created by Freemarker with encoded parameter: testurl.html?key=Q%23106368%2011
I use JavaScript to redirect to this URL (reason: I use JS to control 2 frames at the same time).
The redirect method is simple:
function redir(url) {
window.location.href = url;
}
JS call created by Freemarker looks like
<a href="javascript:redir('http://localhost:8080/testappp/testurl.html?key=Q%23106368%2011');">test</a>
My problem is that the browser / Javascript converts the URL into an encoded parameter, considers that there is #and is disabled there.
window.location.href='http://...', . URL-, , URL- #.
?
, #, . $$$hash$$$, . , ...