I am calling goog.net.XhrIo from within this onclick event
goog.events.listen(invBtn, goog.ui.Component.EventType.ACTION,
function(e) {
goog.net.XhrIo.sent('http://remotehost.com:8080/customer/add');
(update :typo here send instead of sent )
This is the very basic task I want to accomplish but this call doesn't even reach the server. I also tried passing url as goog.Uri , doesn't help. I wonder what is stopping from making this call to the server, I tried both host name and ip address but neither helps. It just does nothing.
Is there any thing I can do to see why this call fails to even reach the server.
Appreciate any help
regards Eddie
In your plovr config file, set the warning level to
VERBOSE
:With
VERBOSE
warnings enabled, running your program shows the following warning:Try changing
goog.net.XhrIo.sent();
togoog.net.XhrIo.send();
.In addition, you may want to pass a callback function to the XhrIo send function as follows:
Another common pattern is to create an xhr object and register an event listener:
Further Reading
Closure: The Definitive Guide, Chapter 7: Client-Server Communication