How to json parse a url parameter in android webview?

折月煮酒 提交于 2019-12-02 13:05:15

I am not too sure what you are trying to achieve but..

Based on your given code:

.... 

 var _$p = window.page = {
        version: "0.1"
    };

 //create variables to store your "local variables"
 var local_url = "";
 var local_title = "";

function Response(xhr) {
    this.xhr = xhr;
    this.status = xhr.status;
}

 ....

_$p.navigate = function(url, title) {
        rpc.exec(// JSON-RPC 2.0
            {method: "navigate", params: {
                "url": url, 
                "title": title
            }}, rpc.type.SMALL);

      //save your variables into your "local variables"
       local_url = url;
       local_title = title;
};

Note: The variables will only be available after $p.navigate is called. Otherwise, it will be an empty string.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!