Skip to content

Fix form handling in IE 10.#74

Open
dumbmatter wants to merge 1 commit intoolivernn:masterfrom
dumbmatter:master
Open

Fix form handling in IE 10.#74
dumbmatter wants to merge 1 commit intoolivernn:masterfrom
dumbmatter:master

Conversation

@dumbmatter
Copy link
Copy Markdown

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.

1 participant