ykuramochi / jquery-jsonp

Automatically exported from code.google.com/p/jquery-jsonp
0 stars 0 forks source link

3 GET requests per call in IE6 over HTTPS #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The browser is IE6
2. The connection is HTTPS
3. It works fine when requesting from localhost

What is the expected output? What do you see instead?
I ask for one ajax call and want to see 1 GET request to the server.
Instead there are 3 requests. 2 of them completely identical, the third is 
different in one line in the header. See attached file.

What version of the product are you using? On what operating system?
2.1.3, Win XP, IE6

Please provide any additional information below.
Debugged with DebugBar for IE, and server logs show also the triple requests. 
No triplication in FF or Chrome. No triplication when the server is localhost. 
Can't test without https now, maybe that doesn't matter. No error from the ajax 
request. I emptied the "success" method so I can't do anything silly, but same 
triplication. Changed back to jquery.ajax request, no triplication. I added the 
logs of the jquery.ajax call also to the attached file.

Original issue reported on code.google.com by foldi.pe...@gmail.com on 30 Nov 2010 at 9:07

Attachments:

GoogleCodeExporter commented 8 years ago
As interesting as traffic logs can be, I'd be much more interested in actual 
code that demonstrates the issue, just to safely remove any other possible 
explanation.

Whatever is going on here sure looks weird.

Original comment by aubourg.julian on 30 Nov 2010 at 11:05

GoogleCodeExporter commented 8 years ago
Sorry, forgot that. Tomorrow from the office. Believe me, it's just the very 
basic usage of the lib but I will provide the code tomorrow (GMT).

Original comment by foldi.pe...@gmail.com on 30 Nov 2010 at 11:17

GoogleCodeExporter commented 8 years ago
Calling code attached. I don't believe that it matters but it's in a jquery 
plugin, I included the surrounding code too.

Original comment by foldi.pe...@gmail.com on 1 Dec 2010 at 10:19

Attachments:

GoogleCodeExporter commented 8 years ago
Any idea? What I found strange in the logs I attached is that the default 
jquery.ajax request is a XMLHttpRequest, but the jquery docs says that: 
"[error] This handler is not called for JSONP requests, because they do not use 
an XMLHttpRequest." This doesn't answer why the jsonp sends 3 requests by call, 
but it's strange and maybe gives some hints to somebody who understands these 
things more than I do.

Original comment by foldi.pe...@gmail.com on 2 Dec 2010 at 11:31

GoogleCodeExporter commented 8 years ago
Yeah, this XMLHttpRequest reference is bugging me.

It's nice of you to have included the call to the plugin but I'm afraid we'll 
need a little more context here.

Original comment by aubourg.julian on 2 Dec 2010 at 11:49

GoogleCodeExporter commented 8 years ago
OK. Spent the past 3 hours to localize the issue. You won't be happy :). I hope 
you can reproduce it. Attached is my source. When I remove the img in the 8th 
line, there is just 1 request, when it has the img line I have 3 requests.
Also attached the headers of the good request and the 3 "bad" requests.
Don't forget: this just happens when the server is not the localhost.

Original comment by foldi.pe...@gmail.com on 2 Dec 2010 at 3:05

Attachments:

GoogleCodeExporter commented 8 years ago
nothing? :( Can you reproduce it?

Original comment by foldi.pe...@gmail.com on 8 Dec 2010 at 7:41

GoogleCodeExporter commented 8 years ago
No, actually, I can't.

Seeing your code I'd suggest one thing though: put the script in the head of 
your document. If your success and error callbacks actually modify the DOM, 
then use jQuery's DOM Readyness detection. Something along the lines of:

$.jsonp({
  success: function( data ) {
    $( function() {
      // Actual code
    } );
  }
})

That's the only thing bothering me in your code actually. That and the fact you 
use the type & dataType options which have no effect in jsonp (dataType is 
always "jsonp" and type is ALWAYS "GET").

Original comment by aubourg.julian on 9 Dec 2010 at 12:01

GoogleCodeExporter commented 8 years ago
Any news?

Original comment by jul...@creative-area.net on 12 Dec 2010 at 2:03

GoogleCodeExporter commented 8 years ago
Closing as invalid.

Original comment by jul...@creative-area.net on 4 Jan 2011 at 1:23