Download attribute with a file name not working?

According to HTML element reference->[a] Can be used with blob: URLs and data: URLs, to make it easy for users to download content that is generated programmatically using JavaScript (e.g. a picture created using an online drawing Web app). If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the … Read more

Href without http(s) prefix

It’s possible, and indeed you’re doing it right now. It just doesn’t do what you think it does. Consider what the browser does when you link to this: href=”https://stackoverflow.com/questions/43803778/index.html” What then would it do when you link to this?: href=”https://stackoverflow.com/questions/43803778/index.com” Or this?: href=”www.html” Or?: href=”www.index.com.html” The browser doesn’t know what you meant, it only knows … Read more

Make anchor links refer to the current page when using

I found a solution on this site: using-base-href-with-anchors that doesn’t require jQuery, and here is a working snippet: <base href=”https://example.com/”> <a href=”http://stackoverflow.com/test”>/test</a> <a href=”javascript:;” onclick=”document.location.hash=”test”;”>Anchor</a> Or without inline JavaScript, something like this: document.addEventListener(‘DOMContentLoaded’, function(){ var es = document.getElementsByTagName(‘a’) for(var i=0; i<es.length; i++){ es[i].addEventListener(‘click’, function(e) { e.preventDefault() document.location.hash = e.target.getAttribute(‘href’) }) } })

how to exchange variables between two HTML pages?

In example1.html: <a href=”https://stackoverflow.com/questions/3724106/example2.html?myVar1=42″>a link</a> <a href=”example2.html?myVar1=43″>another link</a> or generate the links with Javascript as desired. Just make sure the ?varName=value gets onto the end of example2.html somehow. Then, in example2.html, you use Javascript to parse the query string that example2 came with. To do this, you could try Querystring. // Adapted from examples on … Read more

AngularJS All slashes in URL changed to %2F

%2F is the percent-encoding for the forward-slash / character. This problem is related to the fact that AngularJS 1.6 has changed the default for hash-bang urls in the $location service. To revert to the previous behavior: appModule.config([‘$locationProvider’, function($locationProvider) { $locationProvider.hashPrefix(”); }]); For more information, see SO: angularjs 1.6.0 (latest now) routes not working.