Read the documentation. CAREFULLY...

Category: Technology |

21 June 2010

Today I spent one hour trying to figure out why I wasn't getting the right response from the AJAX call using jQuery. There were no JS errors, fake repository once called directly was giving me the response/data back but not using the AJAX.

Looking at the documentation, I tried different methods to resolve the issue, but without success. Finally my boss figured out what was wrong and it was the lamest mistake that I could possibly make. As usual, devil is in the details.

In my JS code I had:

$.ajax({
URL: $url,
success: function(data){...

instead of

$.ajax({
url: $url,
success: function(data){...

URL vs. url makes a difference. JS is case sensitive...

Tags: jQuery code

Comments

blog comments powered by Disqus

Flickr

  • Sunrise over velvet clouds.
  • Tree and clear, dark sky.
  • Ruins of a shelter. The entrance.
  • Sunrise over the Howth, view from Sutton

blog categories

worth visiting

Smashing Magazine
Tutorials, showcases, inspiration