On Monday, May 16, 2016 at 4:15:53 PM UTC-4, Vic Ding wrote:
>
> This is the XHR
> <html><body><h1>invalid function (default/removeProduct)
> </h1></body></html>
>
> That's not a 200 response, so it will not trigger the DIV removal.
 

> The removeProduct function is located under product.py not default.
>

Then your URL is incorrect -- if you don't provide an app and controller to 
the URL() function, it assumes the current app and current controller. In 
your call to URL(), you only included the function. Also, rather than do 
'function/arg', you should use the "args" argument to specify URL args.
 

> This is the strange part for me, the ajax call to 
> product/removeProduct/pid is successful as the database record is indeed 
> removed.
>

If there is an Ajax call going to /product/removeProduct/pid, it is not 
coming from the link you showed in your code, as that link generates the 
wrong URL (and as you have shown, that request ultimately fails). Without 
seeing all of your code, it's hard to say how that other request is getting 
generated.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to