使用代码查询快递信息的方法(与查询天气的方式雷同)

news/2025/11/23 17:28:43/文章来源:https://www.cnblogs.com/yangrui6969/p/19261060

第一步:在标签中添加JS文件

屏幕截图 2025-11-23 170111

具体内容如下:
屏幕截图 2025-11-23 170335

第二步:写出大概的框架
屏幕截图 2025-11-23 170650

第三步:写JS部分

 (1)定义appkey和API地址

屏幕截图 2025-11-23 170922

 (2)校验输入和显示加载状态

屏幕截图 2025-11-23 171104

  (3)调用API和解析返回数据

屏幕截图 2025-11-23 171431

  (4)展示拼接内容和判断内容是否正确

屏幕截图 2025-11-23 171618

第四步:保存并运行查看结果
示例如下:
屏幕截图 2025-11-23 171845

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/974069.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

1101. Quick Sort (25)

1101. Quick Sort (25)#include <iostream> #include <vector> #include <algorithm>using namespace std;int num[100010], low[100010], high[100010];int main() {int n;scanf("%d", &…

1100. Mars Numbers (20)

1100. Mars Numbers (20)#include <iostream> #include <string.h>using namespace std;char ch[2][13][5] = {"tret", "jan", "feb", "mar", "apr",…

解码网络编程基础

进程间通信方式 基础概念 程序是数据和指令的集合,运行时成为进程,操作系统会为其分配资源并记录参数。同一主机内进程通信可通过管道、信号、消息队列、信号量集、共享内存实现,这些方式依赖主机本地系统资源,无法…

C++的3种继承方式

C++的3种继承方式 在 C++ 中,继承方式(public、protected、private)决定了基类成员在派生类中的访问权限,以及派生类对象对基类成员的访问权限。正确选择继承方式是实现封装、复用和多态的关键。以下是三种继承方式…

1082. Read Number in Chinese (25)

1082. Read Number in Chinese (25)#include <iostream> #include <string.h>using namespace std;int first = 1;void setfirst() {if(first == 1){first = 0;}else{printf(" ");} }int main()…

1081. Rational Sum (20)

1081. Rational Sum (20)#include <iostream>using namespace std;long long getsame(long long a, long long b) {if(b != 0){return getsame(b, a % b);}else{return a;} }void simplify(long long &a, lo…

1067. Sort with Swap(0) (25)

1067. Sort with Swap(0) (25)#include <iostream>using namespace std;int index[100010], num[100010];int main() {int n;scanf("%d", &n);int i, count = 0;for(i = 0; i < n; i++){scanf(…

1066. Root of AVL Tree (25)

1066. Root of AVL Tree (25)#include <iostream> #include <stdlib.h>using namespace std;typedef struct node {int key, bf;struct node *lchild, *rchild; }*bnode;void rrotate(bnode *root) {bnode…

1070. Mooncake (25)

1070. Mooncake (25)#include <iostream> #include <algorithm>using namespace std;struct node {double amounts, prices, perprice; }mooncakes[1010];int cmp(node n1, node n2) {return n1.perprice …

1069. The Black Hole of Numbers (20)

1069. The Black Hole of Numbers (20)#include <iostream> #include <string.h> #include <algorithm>using namespace std;int cmp(char a, char b) {return a > b; }int main() {int num[2];s…

1050. String Subtraction (20)

1050. String Subtraction (20)#include <iostream> #include <string.h>using namespace std;int flag[130]; char s[2][10010];int main() {int i, len[2];for(i = 0; i <= 1; i++){gets(s[i]);len[i…

1049. Counting Ones (30)

1049. Counting Ones (30)#include <iostream>using namespace std;int main() {int n;scanf("%d", &n);int low, mid, high, d = 1, res = 0;while(n >= d){high = n / (d * 10);mid = (n - h…

1045. Favorite Color Stripe (30)

1045. Favorite Color Stripe (30)#include <iostream>using namespace std;int fav[210], ori[10010], res[210][10010];int getmax(int a, int b) {if(a > b){return a;}else{return b;} }int main() {int …

1048. Find Coins (25)

1048. Find Coins (25)#include <iostream> #include <algorithm>using namespace std;int c[510], num[100010];int main() {int n, m;scanf("%d%d", &n, &m);int i;for(i = 1; i <…

1052. Linked List Sorting (25)

1052. Linked List Sorting (25)#include <iostream> #include <algorithm> #include <vector>using namespace std;struct node {int address, key, next; }nod[100000];int cmp(node n1, node n2)…

1051. Pop Sequence (25)

1051. Pop Sequence (25)#include <iostream> #include <stack>using namespace std;int main() {int m, n, k;scanf("%d%d%d", &m, &n, &k);int i, num[1010], j, index, flag, be…

卡塔兰long long

1.mod 我们用递推式用加法避免除和mod include <bits/stdc++.h> using namespace std; long long dp[105]; long long f(int x) { if(dp[x]!=-1) return dp[x]; dp[x]=0;//归0 for(int i=0;i<x;i++) { dp[x]=…

1038. Recover the Smallest Number (30)

1038. Recover the Smallest Number (30)#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <vector>using namespace std;int cmp(string a,…

1037. Magic Coupon (25)

1037. Magic Coupon (25)#include <iostream> #include <vector> #include <algorithm>using namespace std;int main() {int nc;scanf("%d", &nc);int i;vector<long long> v[…

1040. Longest Symmetric String (25)

1040. Longest Symmetric String (25)#include <iostream> #include <string.h>using namespace std;int main() {char s[1010];gets(s);int len = strlen(s), i, count, res = 0, j, k;for(i = 0; i <…