Bug Tracker

Modify

Ticket #8436 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

ajax method failing unexpectedly

Reported by: cmcculloh Owned by:
Priority: undecided Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc: jaubourg
Blocking: Blocked by:

Description (last modified by addyosmani) (diff)

Firefox 3.6.14 JBoss-4.0.5.GA/Tomcat-5.5 ATGPlatform 2007.1

When submitting an AJAX request (GET or POST) and specifying a dataType of "json" a callback param is sent along with the URL (as if I had specified "jsonp" as the dataType).

I was unable to create a good simplified test case. However, I believe I may have narrowed it down to perhaps being something to do with the Content-Type of the request.

This began occurring with v1.5

Here are headers from a "working" request/response:

 http://screencast.com/t/GTmWxYwAjno

Response Headersview source
Server	Apache-Coyote/1.1
X-Powered-By	Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
X-ATG-Version	ATGPlatform/2007.1p3 [ DPSLicense/0 ]
Content-Type	application/json;charset=ISO-8859-1
Content-Length	824
Date	Thu, 03 Mar 2011 17:09:15 GMT
Request Headersview source
Host	local.finishline.com
User-Agent	Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
Accept	application/json, text/javascript, */*; q=0.01
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
X-Requested-With	XMLHttpRequest
Referer	http://local.finishline.com/store/test-ajax.jsp
Cookie	JSESSIONID=1EA8B9CFD46CA1D9D5A2DDFBCCF50EF3; ATG_SESSION_ID=1EA8B9CFD46CA1D9D5A2DDFBCCF50EF3; fl_shoppingcart_items=|sku1820044|sku1820083|sku1820083|sku1820083|sku1820044|sku1820044|sku1820044; fl_favorite_shipped=; fsr.s={"f":1299171920303,"cp":{"test":"Current"},"v":1,"rid":"1299171804840_708190","ru":"http://local.finishline.com/store/","r":"local.finishline.com","st":"","pv":2,"to":3,"c":"http://local.finishline.com/store/shop/mens/casual-shoes/_/N-1sb9jZ1sb8f/Ns-P_BestSellers|1","lc":{"d2":{"v":2,"s":false}},"cd":2,"sd":2}; mbox=session#1299171800449-835792#1299173782|check#true#1299171982; __unam=795587f-12e7cac7808-161f54c4-2; s_cc=true; s_sq=finishlinedev%3D%2526pid%253DMen%252520%25253A%252520Casual%252520Shoes%2526pidt%253D1%2526oid%253Dfunctiononclick%252528event%252529%25257BqlDisplayPopup%252528%252522prod670521%252522%25252C%252522false%252522%252529%25253B%25257D%2526oidt%253D2%2526ot%253DIMG; s_vi=[CS]v1|26B7E4EC85010F38-60000101401B1D48[CE]; _msuuid_787k4h6228=69812EFA-FA30-4090-A7A4-25077061B86D

Here are headers from a failing request/response:

 http://screencast.com/t/VRxKKZrA3

Response Headersview source
Server	Apache-Coyote/1.1
X-Powered-By	Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
X-ATG-Version	ATGPlatform/2007.1p3 [ DPSLicense/0 ]
Content-Type	application/json;charset=ISO-8859-1
Content-Length	824
Date	Thu, 03 Mar 2011 17:09:15 GMT
Request Headersview source
Host	local.finishline.com
User-Agent	Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
Accept	application/json, text/javascript, */*; q=0.01
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
X-Requested-With	XMLHttpRequest
Referer	http://local.finishline.com/store/test-ajax.jsp
Cookie	JSESSIONID=1EA8B9CFD46CA1D9D5A2DDFBCCF50EF3; ATG_SESSION_ID=1EA8B9CFD46CA1D9D5A2DDFBCCF50EF3; fl_shoppingcart_items=|sku1820044|sku1820083|sku1820083|sku1820083|sku1820044|sku1820044|sku1820044; fl_favorite_shipped=; fsr.s={"f":1299171920303,"cp":{"test":"Current"},"v":1,"rid":"1299171804840_708190","ru":"http://local.finishline.com/store/","r":"local.finishline.com","st":"","pv":2,"to":3,"c":"http://local.finishline.com/store/shop/mens/casual-shoes/_/N-1sb9jZ1sb8f/Ns-P_BestSellers|1","lc":{"d2":{"v":2,"s":false}},"cd":2,"sd":2}; mbox=session#1299171800449-835792#1299173782|check#true#1299171982; __unam=795587f-12e7cac7808-161f54c4-2; s_cc=true; s_sq=finishlinedev%3D%2526pid%253DMen%252520%25253A%252520Casual%252520Shoes%2526pidt%253D1%2526oid%253Dfunctiononclick%252528event%252529%25257BqlDisplayPopup%252528%252522prod670521%252522%25252C%252522false%252522%252529%25253B%25257D%2526oidt%253D2%2526ot%253DIMG; s_vi=[CS]v1|26B7E4EC85010F38-60000101401B1D48[CE]; _msuuid_787k4h6228=69812EFA-FA30-4090-A7A4-25077061B86D

I can work around this by receiving and then responding with the callback param. This is sub-optimal.

Here is the AJAX method for the working case:

 http://jsfiddle.net/cmcculloh/JGuCN/2/ (the url that ends up being requested by this ajax method is:  http://local.finishline.com/store/ajax-response.jsp?productId=productId&quantity=1&skuSelection=selectedSkuValue)

Here is the AJAX method for the non-working case:

 http://jsfiddle.net/cmcculloh/VLVSS/ (the url that ends up being requested by this ajax method is:  http://local.finishline.com/store/global/fragments/addItemToDynamicCart.jsp?callback=jQuery15108998590407517931_1299172791631&productId=productId&quantity=1&skuSelection=selectedSkuValue&_=1299172796425) (the url that I expected to be requested by this ajax method is:  http://local.finishline.com/store/global/fragments/addItemToDynamicCart.jsp?productId=productId&quantity=1&skuSelection=selectedSkuValue)

Please feel free to contact me for more information. I'm happy to do anything I can to help.

Change History

comment:1 Changed 3 years ago by addyosmani

  • Cc jaubourg added
  • Description modified (diff)

Reformatted the ticket a little to avoid long URLs spilling beyond the main content container.

Last edited 3 years ago by addyosmani (previous) (diff)

comment:2 Changed 3 years ago by jaubourg

  • Status changed from new to closed
  • Resolution set to duplicate
  • Version changed from 1.5.1 to 1.5
  • Component changed from unfiled to ajax

comment:3 Changed 3 years ago by jaubourg

Duplicate of #8084.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.