Google Closure XhrIo

I am new to Google Closure, and I would like to know how XhrIo works. I read an XHRIO review of http://code.google.com/closure/library/docs/xhrio.html

Basically, I am following an example, but I just can't get it to work. I use eclipse and tomcat as my server to run the example. Can someone please enlighten me how to make a connection between html, a java script that uses goog.require ('goog.net.XhrIo'); and json file? Thanks guys.

+6
source share
1 answer

Here is an example to make a mail request:

goog.require('goog.Uri'); goog.require('goog.net.XhrIo'); var qd = new goog.Uri.QueryData(); qd.add('name1', 'val1'); qd.add('name2', 'val2'); function done(e) { this.getResponseText(); this.getResponseJson(); } goog.net.XhrIo.send('/controller/action', done, 'POST', qd.toString()); 
+10
source

Source: https://habr.com/ru/post/895823/


All Articles