#11023 closed bug (wontfix)
Ajax calls to # fail in IE
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | ajax | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Ajax calls made to '#' fail in Internet Explorer but they work in Firefox as expected.
Just like it's possible to post your form to '#' to post to the current page.
Even though the result in the fiddle is garbage, the error case is called in Internet Explorer and the success case is called in Firefox
Change History (7)
comment:1 Changed 11 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 11 years ago by
Status: | pending → new |
---|
I usually do this if I want to send the form to the current page instead of an empty action so I know I didn't accidentally leave it empty.
But the ajax call will fail the same way if I leave the action/ajax-url empty.
comment:3 Changed 11 years ago by
Status: | new → pending |
---|
It would seem that allowing this URL inside jQuery would involve mangling the incoming string somehow, which will inevitably bring other complications. I would prefer that the caller pass in a usable URL.
I've always explicitly used location.href
to post back to the page, are there any drawbacks to doing that?
comment:4 Changed 11 years ago by
Status: | pending → new |
---|
That's how I solved it right now.
I made a function that automatically enhanced normal forms with an ajax version. And this functions simply took the action and used this as the ajax url.
After I noticed that the calls would fail with "" and "#", I added a regex replace that replaces "" and "#" from the action to document.location.href
But I thought it might be something that jQuery could do to make the experience the same in a cross browser fashion.
comment:5 Changed 11 years ago by
I agree with Dave on this one - I think we should we should expect a sensible URL to be passed. I don't think there's a case for us changing the incoming string just to enable the support for '#'. I'll ask in -dev later just to check if there are arguments for keeping this open :)
comment:6 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Use location.href
when needed.
What is the use case for posting to '#'?