1

Well i would like to know something about JSONP,

like when someone enter in my website and i do a ajax request with dataType JSONP,

this request will be done like when this same person enter direct in this page? i.e: this page that ajax will request with JSONP get the IP of the user,

it will get the real ip of this user? similar to a iframe i mean.

thanks.

4
  • You question might be unclear. But the IP visible by the server is the same whatever the type of request. Commented Mar 30, 2013 at 19:57
  • 2
    JSONP is actually no Ajax call. It's including a script element referring to an external script (does not have to be external though), just like you include jQuery from a CDN. Commented Mar 30, 2013 at 20:01
  • Well if i do a ajax request JSONP in some url that counts downloads for IP it will be counted isn't? cuz it will use the user ip, isn't? Commented Mar 30, 2013 at 20:03
  • 2
    Since all of the Internet communication is based on the IP protocol (en.wikipedia.org/wiki/Internet_Protocol), yes, any connection will involve IP addresses. JSONP and Ajax are protocols/techniques at a much higher level. Commented Mar 30, 2013 at 20:09

2 Answers 2

2

Every request to a server contains the client's IP address. This also applies to JSONP, which is implemented using an HTTP GET request.

1
  • +1 correct. I fixed your formatting. If I recall correctly this is in fact because of the underlying TCP protocol. Commented Mar 30, 2013 at 20:00
1

Yes, the call is made by the browser, so it will use the IP address and settings of the user.

A JSONP call is actually a script tag that makes the request, so it will look to the server just as any other script tag loading script from the server.

Not the answer you're looking for? Browse other questions tagged or ask your own question.