nette.ajax.js
nette.ajax.js copied to clipboard
IE11 bug when absolute URL is used
When absolute URL is used on AJAX link, there is new URL() used, which is not supported in IE11.
More over, when the URL is parsed, the regular expression below doesn't make any sense (or does it?):
- There is
pathnameproperty used in string, which never should contain port number, so checking the port number is unnecessary. Port number would be inhost(or even better inport). - The URL object always contains leading
/inpathname, even though thepathnamemight be missing in link. So even URL eg. "http://www.example.com#foo" will returnpathnameequal to/. Therefore,parsedUrl['pathname'] + parsedUrl['search'] + parsedUrl['hash']may never begin with#, but always with/.
So in my opinion, the correct condition should be if pathname from current location is the same as in parsedUrl, search is the same and hash is specified in parsedUrl. If so, return false, otherwise return true. Is that correct or am I missing something?
I believe I've solved this by PR https://github.com/vojtech-dobes/nette.ajax.js/pull/164.