Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 bug when absolute URL is used #163

Open
zipper opened this issue May 27, 2019 · 1 comment
Open

IE11 bug when absolute URL is used #163

zipper opened this issue May 27, 2019 · 1 comment

Comments

@zipper
Copy link

zipper commented May 27, 2019

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 pathname property used in string, which never should contain port number, so checking the port number is unnecessary. Port number would be in host (or even better in port).
  • The URL object always contains leading / in pathname, even though the pathname might be missing in link. So even URL eg. "http://www.example.com#foo" will return pathname equal 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?

zipper added a commit to zipper/nette.ajax.js that referenced this issue May 27, 2019
- do not use new URL constructor, use custom function instead
- changed condition whether to use ajax when absolute URL is used
zipper added a commit to zipper/nette.ajax.js that referenced this issue May 30, 2019
- do not use new URL constructor, use custom function instead
- changed condition whether to use ajax when absolute URL is used
zipper added a commit to zipper/nette.ajax.js that referenced this issue May 30, 2019
- do not use new URL constructor, use custom function instead
- changed condition whether to use ajax when absolute URL is used
@zipper
Copy link
Author

zipper commented May 30, 2019

I believe I've solved this by PR #164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant