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

Fix form handling in IE 10. #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dumbmatter
Copy link

In IE10, it seems that normal links are routed fine, but forms are not.
Minimal example: http://jsfiddle.net/xg4Hr/2/ - In Firefox and Chrome,
clicking the GET and POST buttons display "GET" and "POST" as you'd
expect. In IE10, the Davis.js routing is ignored and you get a 404
error. I narrowed the problem down to the originChecks function in
davis.listener.js, on this line:

a.href = elem.action

In Firefox and Chrome, this will make a.host equal to the domain
name. In IE10, the port number gets stuck on the end of a.host, for
some reason. This makes this.A(a) on the next line return false since
Davis.js thinks it is an external link. I worked around this by creating
a2 to compare with a.

In IE10, it seems that normal links are routed fine, but forms are not.
Minimal example: http://jsfiddle.net/xg4Hr/2/ - In Firefox and Chrome,
clicking the GET and POST buttons display "GET" and "POST" as you'd
expect. In IE10, the Davis.js routing is ignored and you get a 404
error. I narrowed the problem down to the `originChecks` function in
davis.listener.js, on this line:

    a.href = elem.action

In Firefox and Chrome, this will make `a.host` equal to the domain
name. In IE10, the port number gets stuck on the end of `a.host`, for
some reason. This makes `this.A(a)` on the next line return false since
Davis.js thinks it is an external link. I worked around this by creating
`a2` to compare with `a`.
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

Successfully merging this pull request may close these issues.

None yet

1 participant