Ticket #10376 (closed bug: invalid)
ajaxStart() is inadvertently fired when the page is loaded through HTTPS and getScript() calls the same domain via HTTPS too
| Reported by: | vbenincasa | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
ajaxStart() is inadvertently fired when the page is loaded through HTTPS and getScript() calls the same domain via HTTPS too.
Bug occurs (https) -an alert shows "booom"-: https://unihostbrasil.com.br/diversos/bug-jquery-ajaxstart/
Bug doesn't occurs (http): http://unihostbrasil.com.br/diversos/bug-jquery-ajaxstart/
It does not occur if:
- The page with the script isn't called through HTTPS (sample above)
- getScript() doesn't call the same domain through HTTPS
Additional info:
- Occurs with all jQuery versions (since 1.0)
- Tested and reproduced under Firefox 7, Chrome 14, IE 8 and Opera 11.
Change History
comment:1 follow-up: ↓ 2 Changed 20 months ago by jaubourg
- Status changed from new to closed
- Resolution set to invalid
comment:2 in reply to: ↑ 1 ; follow-up: ↓ 3 Changed 20 months ago by vbenincasa
Replying to jaubourg:
That's not a bug at all... Oo
Why not? ajaxStart() cannot be invoked just if the page is loaded through HTTPS (and getScript() call the same domain through HTTPS too). It is expected the same behavior independent of the protocol.
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 20 months ago by jaubourg
Replying to vbenincasa:
Replying to jaubourg:
That's not a bug at all... Oo
Why not? ajaxStart() cannot be invoked just if the page is loaded through HTTPS (and getScript() call the same domain through HTTPS too). It is expected the same behavior independent of the protocol.
Not it's not. Different protocol means a different domain altogether and, as specifically stated on jQuery's documentation, global events are not supported for cross-domain requests BUT they WILL be fired for same-domain requests.
What you need is to set the global option to false. Which means that:
- you use ajax instead of getScript for better control,
- OR you set global to false globally using ajaxSetup
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

That's not a bug at all... Oo