Example usage for com.google.gwt.query.client.js JsUtils parseJSON

List of usage examples for com.google.gwt.query.client.js JsUtils parseJSON

Introduction

In this page you can find the example usage for com.google.gwt.query.client.js JsUtils parseJSON.

Prototype

public static Properties parseJSON(String json) 

Source Link

Document

Parses a json string returning a Object with useful method to get the content.

Usage

From source file:com.github.jdramaix.client.ConverterApp.java

License:Apache License

private void onreadystatechange(XMLHttpRequest xhr) {
    if (xhr.getReadyState() == 4) {
        Properties json = JsUtils.parseJSON(xhr.getResponseText());
        if (xhr.getStatus() == 200) {
            displayAnswer(json.getStr("result"));
            console.log("Logs form server: \n" + json.getStr("logs"));
        } else {//from  ww w .ja  v a 2  s  . c  om
            Window.alert("Ooops something went wrong... Please try again!");
            console.log(json.getStr("result"));
        }

        uploadUrl = json.getStr("nextUrl");
    }
}