简体   繁体   English

需要原生Android / Java方法来查询在线搜索字段

[英]Need Native Android/Java Method to Query Online Search Field

I'd like to query a .cfm page via Android but I'm not sure what method I should be using to do so - any suggestions? 我想通过Android查询.cfm页面,但是我不确定应该使用哪种方法进行操作-有什么建议吗?

Example: 例:

http://www.sheriff.org/apps/arrest/results.cfm?lname=smith&fname= http://www.sheriff.org/apps/arrest/results.cfm?lname=smith&fname=

PS 聚苯乙烯

Would I use something along the lines of this? 我会使用与此类似的东西吗?

http://androidexample.com/AsyncroTask_Example_To_Get_Server_Data_-_Android_Example/index.php?view=article_discription&aid=59&aaid=84 http://androidexample.com/AsyncroTask_Example_To_Get_Server_Data_-_Android_Example/index.php?view=article_discription&aid=59&aaid=84

use an ajax call with the url with the appropriate first and last name parameters, and then extract the result table from the return value. 使用带有相应的名字和姓氏参数的url进行ajax调用,然后从返回值中提取结果表。

see a working jsfiddle sample here: http://jsfiddle.net/FhHXK/ 在此处查看有效的jsfiddle示例: http//jsfiddle.net/FhHXK/

code: 码:

$('#get').click(function () {
    $.ajax({
        url:'http://www.sheriff.org/apps/arrest/results.cfm?lname=a&fname=b',
        type: 'GET'
    }).done(function (data){
        var result = $(data).find('table.datagrid');
        console.log(result.html());
        $('body').append(result);
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM