首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何自动保存自动补全值?

如何自动保存自动补全值?
EN

Stack Overflow用户
提问于 2011-04-08 22:29:35
回答 1查看 84关注 0票数 1

如何保存在文本框中键入内容后显示的自动完成值?请参阅here (例如,在下方的文本框中键入2440 )

我需要输入一个邮政编码,才能看到他们接受的自动补全值为“郊区,州,邮政编码”的格式(否则不起作用)。所以我想自动发送一堆邮政编码,并保存出现在特定邮政编码上的“自动补全值”(或“建议值”)。

我想我可以从Firebug控制台使用javascript来欺骗站点,使其认为是用户输入邮政编码并保存返回数据,而不是将其显示为建议。但我不能走得太远。

你认为如何?

顺便说一句,这里没有任何违法或不道德的东西。

EN

回答 1

Stack Overflow用户

发布于 2011-04-08 22:48:03

如果您有firebug,那么您可以简单地查看ajax请求并从response选项卡中复制json。

下面是2440的返回值

代码语言:javascript
复制
> {
>     "d": [
>         "{\"First\":\"Aldavilla,NSW,2440\",\"Second\":\"Aldavilla,NSW,2440\"}",
>         "{\"First\":\"Alstonville,NSW,2477\",\"Second\":\"Alstonville,NSW,2477\"}",
>         "{\"First\":\"Ballina,NSW,2478\",\"Second\":\"Ballina,NSW,2478\"}",
>         "{\"First\":\"Ballina East,NSW,2478\",\"Second\":\"Ballina
> East,NSW,2478\"}",
>         "{\"First\":\"Bangalow,NSW,2479\",\"Second\":\"Bangalow,NSW,2479\"}",
>         "{\"First\":\"Banora Point,NSW,2486\",\"Second\":\"Banora
> Point,NSW,2486\"}",
>         "{\"First\":\"Barrington,NSW,2422\",\"Second\":\"Barrington,NSW,2422\"}",
>         "{\"First\":\"Baryulgil,NSW,2460\",\"Second\":\"Baryulgil,NSW,2460\"}",
>         "{\"First\":\"Bayldon,NSW,2452\",\"Second\":\"Bayldon,NSW,2452\"}",
>         "{\"First\":\"Bellbrook,NSW,2440\",\"Second\":\"Bellbrook,NSW,2440\"}",
>         "{\"First\":\"Bellingen,NSW,2454\",\"Second\":\"Bellingen,NSW,2454\"}",
>         "{\"First\":\"Bentley,NSW,2480\",\"Second\":\"Bentley,NSW,2480\"}",
>         "{\"First\":\"Bexhill,NSW,2480\",\"Second\":\"Bexhill,NSW,2480\"}",
>         "{\"First\":\"Bilambil,NSW,2486\",\"Second\":\"Bilambil,NSW,2486\"}",
>         "{\"First\":\"Bingara,NSW,2404\",\"Second\":\"Bingara,NSW,2404\"}",
>         "{\"First\":\"Blakebrook,NSW,2480\",\"Second\":\"Blakebrook,NSW,2480\"}",
>         "{\"First\":\"Boambee,NSW,2450\",\"Second\":\"Boambee,NSW,2450\"}",
>         "{\"First\":\"Bobin,NSW,2429\",\"Second\":\"Bobin,NSW,2429\"}",
>         "{\"First\":\"Bogangar,NSW,2488\",\"Second\":\"Bogangar,NSW,2488\"}",
>         "{\"First\":\"Boggabilla,NSW,2409\",\"Second\":\"Boggabilla,NSW,2409\"}",
>         "{\"First\":\"Bonalbo,NSW,2469\",\"Second\":\"Bonalbo,NSW,2469\"}",
>         "{\"First\":\"Bonville,NSW,2441\",\"Second\":\"Bonville,NSW,2441\"}",
>         "{\"First\":\"Boomerang Beach,NSW,2428\",\"Second\":\"Boomerang
> Beach,NSW,2428\"}",
>         "{\"First\":\"Boomi,NSW,2405\",\"Second\":\"Boomi,NSW,2405\"}",
>         "{\"First\":\"Booral,NSW,2425\",\"Second\":\"Booral,NSW,2425\"}",
>         "{\"First\":\"Bowraville,NSW,2449\",\"Second\":\"Bowraville,NSW,2449\"}",
>         "{\"First\":\"Broadwater,NSW,2472\",\"Second\":\"Broadwater,NSW,2472\"}",
>         "{\"First\":\"Brunswick Heads,NSW,2483\",\"Second\":\"Brunswick
> Heads,NSW,2483\"}",
>         "{\"First\":\"Bulahdelah,NSW,2423\",\"Second\":\"Bulahdelah,NSW,2423\"}",
>         "{\"First\":\"Bungwahl,NSW,2423\",\"Second\":\"Bungwahl,NSW,2423\"}",
>         "{\"First\":\"Burringbar,NSW,2483\",\"Second\":\"Burringbar,NSW,2483\"}",
>         "{\"First\":\"Byabarra,NSW,2446\",\"Second\":\"Byabarra,NSW,2446\"}",
>         "{\"First\":\"Byron Bay,NSW,2481\",\"Second\":\"Byron
> Bay,NSW,2481\"}",
>         "{\"First\":\"Cabbage Tree Island,NSW,2477\",\"Second\":\"Cabbage
> Tree Island,NSW,2477\"}",
>         "{\"First\":\"Carool,NSW,2486\",\"Second\":\"Carool,NSW,2486\"}",
>         "{\"First\":\"Cascade,NSW,2453\",\"Second\":\"Cascade,NSW,2453\"}",
>         "{\"First\":\"Casino,NSW,2470\",\"Second\":\"Casino,NSW,2470\"}",
>         "{\"First\":\"Chatsworth Island,NSW,2469\",\"Second\":\"Chatsworth
> Island,NSW,2469\"}",
>         "{\"First\":\"Chillingham,NSW,2484\",\"Second\":\"Chillingham,NSW,2484\"}",
>         "{\"First\":\"Clarenza Via Grafton,NSW,2460\",\"Second\":\"Clarenza
> Via Grafton,NSW,2460\"}",
>         "{\"First\":\"Clunes,NSW,2480\",\"Second\":\"Clunes,NSW,2480\"}",
>         "{\"First\":\"Coffee Camp,NSW,2480\",\"Second\":\"Coffee
> Camp,NSW,2480\"}",
>         "{\"First\":\"Coffs Harbour,NSW,2450\",\"Second\":\"Coffs
> Harbour,NSW,2450\"}",
>         "{\"First\":\"Coffs Harbour Jetty,NSW,2450\",\"Second\":\"Coffs
> Harbour Jetty,NSW,2450\"}",
>         "{\"First\":\"Collins Creek,NSW,2474\",\"Second\":\"Collins
> Creek,NSW,2474\"}",
>         "{\"First\":\"Comboyne,NSW,2429\",\"Second\":\"Comboyne,NSW,2429\"}",
>         "{\"First\":\"Condong,NSW,2484\",\"Second\":\"Condong,NSW,2484\"}",
>         "{\"First\":\"Coolongolook,NSW,2423\",\"Second\":\"Coolongolook,NSW,2423\"}",
>         "{\"First\":\"Coopernook,NSW,2426\",\"Second\":\"Coopernook,NSW,2426\"}",
>         "{\"First\":\"Coorabell,NSW,2479\",\"Second\":\"Coorabell,NSW,2479\"}"
>     ] }

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5596601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档