title: Calling a Django view using Dajax
body: <p>I'm new to both Django and Dajax, but I'm having a problem with a very basic function using Dajax.  Right now, I just want to post a form to Django and return a simple response showing that I reached my endpoint.</p>
  
  <p>However, I keep getting an error returned back to my form.</p>
  
  <p>Here is my form:</p>
  
  <pre><code>{% load dajaxice_templatetags %}
  
  &lt;html&gt;
  
      &lt;head&gt;
          {% dajaxice_js_import %}
  
  
          &lt;script type="text/javascript"&gt;
              function my_js_callback(data){
                  alert(data.message);
              }
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;  
          &lt;form name="new_scan" action="" method="post"&gt;
              {% csrf_token %}                    
  
              &lt;input type="text" id="scan_sku" name="scan_sku" maxlength="10" /&gt;
              &lt;button name="sku_lookup_btn" id="sku_lookup_btn" onclick="Dajaxice.inventory.views.test_ajax(my_js_callback);"&gt;Add to order&lt;/button&gt;
          &lt;/form&gt;     
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is the corresponding view:</p>
  
  <pre><code>@dajaxice_register
  def test_ajax(request):
      return "Hello World"
  </code></pre>
  
  <p>I'm getting a javascript alert that says, "Something goes wrong"</p>
  
  <p>Unfortunately, I don't know how to debug exactly "what went wrong".</p>