Skip to main content

Bug Tracker

Side navigation

#8436 closed bug (duplicate)

Opened March 03, 2011 05:26PM UTC

Closed March 03, 2011 06:58PM UTC

Last modified March 03, 2011 06:58PM UTC

ajax method failing unexpectedly

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

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.

Attachments (0)
Change History (3)

Changed March 03, 2011 06:47PM UTC by addyosmani comment:1

_comment0: → 1299178105911581
cc: → jaubourg
description: 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.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.

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

Changed March 03, 2011 06:58PM UTC by jaubourg comment:2

component: unfiledajax
resolution: → duplicate
status: newclosed
version: 1.5.11.5

Changed March 03, 2011 06:58PM UTC by jaubourg comment:3

Duplicate of #8084.