Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX request gives jQuery mysterious results in Firefox
    primarykey
    data
    text
    <p>I have a webapp written in rails and jQuery that's giving me a mysterious AJAX problem in Firefox.</p> <p>When I make a certain AJAX request against my localhost rails server, jQuery calls the request's error event handler with no interesting error information, printing the arguments to the console reveals only:</p> <pre><code>[Object { readyState=0, status=0, statusText="error"}, "error", ""] </code></pre> <p>Interestingly, the server does receive the request and claims it responds successfully; certainly it does the server-side work it was supposed to. Neither HTTPScoop nor Wireshark have been able to give me any love in sniffing traffic on the loopback interface for some reason. Firebug doesn't report any response information, just an angry red X.</p> <p>Even more interestingly, I get different behavior on heroku. In that case, the AJAX request still fails with no interesting error information given, firebug reports the angry red X, but the server never even receives the request.</p> <p>It seems to be something with Firefox. Curl is able to POST the request successfully, and Safari and Chrome both run the application fine.</p> <p>The problem isn't systemic. I have several other model objects that use the same pattern to save themselves to the server, and they work perfectly. Indeed, if the model is a different type: a line drawn freehand instead of segments, it works perfectly.</p> <p>For what it's worth, the POST data of a failing request might be something like:</p> <pre><code>wall[kind] wall wall[vertex_values][0][x] -60 wall[vertex_values][0][y] -3 wall[vertex_values][1][x] -55 wall[vertex_values][1][y] 2 wall[vertex_values][2][x] -55 wall[vertex_values][2][y] -1 wall[vertex_values][3][x] -55 wall[vertex_values][3][y] -4 wall%5Bkind%5D=wall&amp;wall%5Bvertex_values%5D%5B0%5D%5Bx%5D=-60&amp;wall%5Bvertex_values%5D%5B0%5D%5By%5D=-3&amp;wall%5Bvertex_values%5D%5B1%5D%5Bx%5D=-55&amp;wall%5Bvertex_values%5D%5B1%5D%5By%5D=2&amp;wall%5Bvertex_values%5D%5B2%5D%5Bx%5D=-55&amp;wall%5Bvertex_values%5D%5B2%5D%5By%5D=-1&amp;wall%5Bvertex_values%5D%5B3%5D%5Bx%5D=-55&amp;wall%5Bvertex_values%5D%5B3%5D%5By%5D=-4 </code></pre> <p>While a successful request looks like:</p> <pre><code>wall[kind] drawing wall[vertex_values][0][x] -50.0469798657718 wall[vertex_values][0][y] 1.0961968680089402 wall[vertex_values][1][x] -49.77852348993288 wall[vertex_values][1][y] 0.9172259507829903 wall[vertex_values][2][x] -49.51006711409395 wall[vertex_values][2][y] 0.7382550335570386 wall[vertex_values][3][x] -49.331096196868 wall[vertex_values][3][y] 0.6487695749440636 wall[vertex_values][4][x] -49.107382550335565 wall[vertex_values][4][y] 0.604026845637577 wall[vertex_values][5][x] -48.92841163310961 wall[vertex_values][5][y] 0.5592841163310887 wall[vertex_values][6][x] -48.838926174496635 wall[vertex_values][6][y] 0.5592841163310887 wall[vertex_values][7][x] -48.749440715883665 wall[vertex_values][7][y] 0.5592841163310887 wall%5Bkind%5D=drawing&amp;wall%5Bvertex_values%5D%5B0%5D%5Bx%5D=-50.0469798657718&amp;wall%5Bvertex_values%5D%5B0%5D%5By%5D=1.0961968680089402&amp;wall%5Bvertex_values%5D%5B1%5D%5Bx%5D=-49.77852348993288&amp;wall%5Bvertex_values%5D%5B1%5D%5By%5D=0.9172259507829903&amp;wall%5Bvertex_values%5D%5B2%5D%5Bx%5D=-49.51006711409395&amp;wall%5Bvertex_values%5D%5B2%5D%5By%5D=0.7382550335570386&amp;wall%5Bvertex_values%5D%5B3%5D%5Bx%5D=-49.331096196868&amp;wall%5Bvertex_values%5D%5B3%5D%5By%5D=0.6487695749440636&amp;wall%5Bvertex_values%5D%5B4%5D%5Bx%5D=-49.107382550335565&amp;wall%5Bvertex_values%5D%5B4%5D%5By%5D=0.604026845637577&amp;wall%5Bvertex_values%5D%5B5%5D%5Bx%5D=-48.92841163310961&amp;wall%5Bvertex_values%5D%5B5%5D%5By%5D=0.5592841163310887&amp;wall%5Bvertex_values%5D%5B6%5D%5Bx%5D=-48.838926174496635&amp;wall%5Bvertex_values%5D%5B6%5D%5By%5D=0.5592841163310887&amp;wall%5Bvertex_values%5D%5B7%5D%5Bx%5D=-48.749440715883665&amp;wall%5Bvertex_values%5D%5B7%5D%5By%5D=0.5592841163310887 </code></pre> <p>I'm completely perplexed. Have I hit the weirdest bug ever in Firefox, or am I doing something so stupid it's unfathomable to me?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload