On 12/16/10 6:25 PM, kthomps17 wrote:
>
> So I really thought I had this one, but I was wrong.
>
> I get a response from my ajax post, but I get the html of my view. Here's my
> current POST used to just test if I'm getting what i want:
>
>    function searchMarkers(center) {
>        var URL = document.getElementById('url').innerHTML + '/locator_view';
>        jq.ajax( {
>          type: "POST",
>          url:  URL,
>          data: { "l1": center.geometry.location.lat(), "l2":
> center.geometry.location.lng(), "r":
> document.getElementById('radius').value},
>          error: function(xhr, data, thrownError) {
>              alert(xhr.status);
>              alert(thrownError);
>              alert(data);
>          },
>          success: function(data) {
>              space = document.getElementById('canvas');
>              space.innerHTML = data;
>              return;
>          },
>          dataType: "json"
>        });
>    }
>
> The URL is "http://localhost:8080/plone/dealer-search/locator_view";  with
> locator_view being my view, my BrowserView class is locatorView but I'm not
> sure how I'm supposed POST directly to it so i only get my json response.
> Right now I get a parsererror because it's returning the html of the view.
>

Can you show us how you registered your view?

If you have a module

locator_view.py  which contains

class locatorView(BrowserView):
     ...
     def my_locator(self, arg1, arg2, ...)

then you need to make the 'my_locator' method available
through ZCML under whatever name you want and it is using
that registered name that you call from your JS.

HTH

        Raphael




_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to